LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-21-2005, 11:58 AM   #1
poeta_boy
Member
 
Registered: Oct 2003
Location: Mexico
Distribution: Ubuntu
Posts: 223

Rep: Reputation: 31
JSP context object not found


Hello:

I have an app in tomcat, and having the following web.xml:

Code:
  <context-param>
    	<param-name>database</param-name>
    	<param-value>jdbc:mysql://localhost:3306/dsstdicne05</param-value>
   </context-param>  	
    
    <context-param>
    	<param-name>driver</param-name>
  	<param-value>com.mysql.jdbc.Driver</param-value>
  </context-param>
And I try to use it in a JSP:

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ page language="java" contentType="text/html; charset=iso-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@ page session="true"%>
<jsp:useBean id="bd" class="variables.BD" scope="session" />
<%
	System.out.println("*****Obteniendo datos del ServletContext");
		
	String login = (String)context.getInitParameter("login");
	
%>
But I get the error:
Code:
 
cannot resolve symbol
symbol  : variable context 
location: class org.apache.jsp.InicioS_jsp
	String login = (String)context.getInitParameter("login");
                               ^
1 error
I thought context was an implicit object in a JSP, but it says it's not there...

any ideas?

Thanks

Poeta
 
Old 09-21-2005, 01:06 PM   #2
poeta_boy
Member
 
Registered: Oct 2003
Location: Mexico
Distribution: Ubuntu
Posts: 223

Original Poster
Rep: Reputation: 31
Solved it... I used application.getParameter instead
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Context switches balteo Linux - General 0 09-06-2005 07:09 AM
cgi-bin (object not found, access forbidden) orish Linux - Newbie 3 05-24-2004 03:57 PM
Event driven object-to-object: C++ template class mecanism ( NOT STL or STDC++) bretzeltux Programming 2 12-23-2003 02:45 PM
/usr/libexec/ld-elf.so.1: Shared object "libgd.so.4" not found lxxy *BSD 1 12-04-2003 12:01 PM
In what context do you use Linux? zikhermm Linux - General 12 10-08-2001 12:43 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration