Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JDev 9i, web.xml and getInitParameter() problems

Status
Not open for further replies.

markad2

Programmer
Jan 4, 2002
1
0
0
US
I'm getting started using Jdeveloper 9i and can't get servlet init parameters in web.xml to be seen in init() via getInitParameter. I have a servlet mapping set up in web.xml as:

<servlet>
<servlet-name>myservlet</servlet-name>
<servlet-class>mypackage.MyServlet</servlet-class>
<init-param>
<param-name>param1</param-name>
<param-value>paramValue</param-value>
</init-param>
</servlet>

The init() method in MyServlet is simple:
public void init(ServletConfig config) throws ServletException
{
super.init(config);
String param = config.getInitParameter(&quot;param1&quot;);
}

Instead of getting &quot;paramValue&quot; returned, I get null. Is there something I'm missing (not understanding/configuring) in JDev 9i? I set the source path for the project to include the project's WEB-INF directory. I know the web.xml is being parsed because if I intentionally include syntax errors, JDev complains when it attempts to instantiate the server.

Thanks


 
I had the same problem, This is a bug in Jdev9i. To work arround this problem do not append the package name in the servlet class.

i.e.

<servlet-class>mypackage.MyServlet</servlet-class>
becomes
<servlet-class>MyServlet</servlet-class>


Hope this helps

 
I am sure this solution must have worked. However, problem faced is not a bug as it is dependent upon the way server detects the packages (.jar), while in initialization phase.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top