This week's giveaway is in the Spring forum.
We're giving away four copies of Learn Spring Security (video course) and have Eugen Paraschiv on-line!
See this thread for details.
Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem for getServletConfig in JRun

 
Donald Fung
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

My company has bought JRUN4.0 and migrate some JSP from tomcat to it. However, I get problem when run the web.
I hope someone can help me.
I had some values (context parameter) in the web.xml and want to get them from the JSP. However, the JSP can't get the value.
The Jrun shows that can't find the method and the system can't retrieve the value of SESSION_N with return null. I can get the value in tomcat but not JRun. What's the problem?

Thanks.

In JSP,
<%@page contentType="text/html; charset=iso-8859-1" language="java" import="java.util.*,java.text.*,java.io.*, profile.userObject.*"%>
<%
String session_n = getServletConfig().getInitParameter("SESSION_N");
UsrLoginObject usrInfo = (UsrLoginObject)session.getAttribute(session_n);
%>

In web.xml,
<context-param>
<param-name>SESSION_N</param-name>
<param-value>LoginInfo</param-value>
</context-param>
[ February 01, 2005: Message edited by: Donald Fung ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic