Forums Register Login

Problem in Servlet Request Attribute Listener

+Pie Number of slices to send: Send
Hi all,

I am trying a example on ServletRequestAttributeListener. It's giving error:





Whether for this also, we havr to register in web.xml like below

+Pie Number of slices to send: Send
Nothing wrong with your code. It works fine.
Please check your classpath or other tomcat settings.
+Pie Number of slices to send: Send
Hi Micheal,

You have to register the ServletRequestAttributeListener in the web.xml. Try it and let me know.
+Pie Number of slices to send: Send
You definintely need to add an entry into your web.xml file. Make sure it is there. Although, I would have thought that if it wasn't there, it would just be ignored, as opposed to causing a runtime error?

I have a bunch of tutorials on my website about J2EE and web development. One deals with Listeners, although it is a session listener, as opposed to a request listener. Still, it's the same idea. Plus, the web.xml code is on the page. It might be helpful:

Tutorial on Configuring Listeners in a Servlet/JSP Based Application - With Code!

I hope that helps.

-Cameron McKenzie
+Pie Number of slices to send: Send
I have registerd in the web.xml..

I have the following classpath:
D:\jdk1.5.0_01\lib\servlet.jar;D:\jdk1.5.0_01\lib\xerces-2.3.0;D:\jdk1.5.0_01\lib\xml-apis;.;

I have the below import statemnt:
import javax.servlet.*; //(which will cover all)
import javax.servlet.http.*;//(which will cover all)
import java.io.*;

Other servlets and JSP are compiling & running fine..even I tried the ServletContextListener example from HFSJ and it's wirks fine..

I think it shouldn't be a classpath problem..

And also,Whether for all Listener interfaces, where (in which class) the implementation is implemented does matter? What will be the pros and cons or any guidelines for it?pls explain

Any glue..?
[ December 30, 2006: Message edited by: Micheal John ]
+Pie Number of slices to send: Send
Hi,
I couldn't figure out the problem..any help...?
+Pie Number of slices to send: Send
Hi Michael,

You are having the listener in your servlet itself. Try creating the listener separately and give a try.
incandescent light gives off an efficient form of heat. You must be THIS smart to ride this ride. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 2298 times.
Similar Threads
get servlet name from ServletRequestAttribute Listener
session time out issue it is not get expired in any way
Attribute Listener
how we can get notification of an event listener at web browser
HFSJ Question
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 04:36:07.