This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes Struts 2 Filter mapping Issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts 2 Filter mapping Issue" Watch "Struts 2 Filter mapping Issue" New topic
Author

Struts 2 Filter mapping Issue

Sugantha Jeevankumar
Ranch Hand

Joined: Jun 06, 2007
Posts: 92
I am developing a sample application where I use struts 2 and the client is a java Applet.

From the applet, I create an ObjectOutputStream to write the parameters (in this case a Vector object) and for invoking the struts action, I create an ObjectInputStream by specifying the URL to map, of the form...



My web.xml file is as follows...



My struts.xml is as follows...



Now, whenever I try to invoke my code it says..

java.io.FileNotFoundException: http://172.24.30.15:8084/Chapter1//displayCustDetails
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at com.nortel.accesscare.util.HttpRequestResponseHandler.sendRequest(HttpRequestResponseHandler.java:62)
at com.nortel.accesscare.applet.jACStart.fetchDetails(jACStart.java:111)
at com.nortel.accesscare.applet.jACStart$3.actionPerformed(jACStart.java:89)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

The problem is obviously with the mapping of the URL to the struts action. Can somebody help me out on this... Any pointers would be much helpful. Thanks in advance.


SCJP 5.0
Punit Singh
Ranch Hand

Joined: Oct 16, 2008
Posts: 952


try to change this to



You servletURL is not able to hit the Struts framework here, as exception stack trace is showing that given url is not finding any source. First solve your url problem. Then we will think about struts2 mapping problem.

First manually hit on the browser for given url
http://172.24.30.15:8084/Chapter1/displayCustDetails
if you found any response, then we could move ahead.


SCJP 6
Sugantha Jeevankumar
Ranch Hand

Joined: Jun 06, 2007
Posts: 92
Hi Punit.. Thanks for the reply.

I had already tried that, and I get 404 Page Not Found. We already have an applet based application that runs fine in struts 1.1 using the same approach that I have described before. And there we have used URLs with double slash in them like...

servletURL = new URL("http://172.24.30.15:8084/Chapter1//displayCustDetails");

I am facing this issue while trying to port this application to struts 2.
BTW, I have tried many different combinations of *.do in web.xml and struts.xml and I get the FileNotFoundException all the time.

Will be happy if anyone could point out what I am doing wrong. Thanks so far.
Sugantha Jeevankumar
Ranch Hand

Joined: Jun 06, 2007
Posts: 92
Can somebody help me out... I am lost at the moment.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Struts 2 Filter mapping Issue
 
Similar Threads
How to configure tiles with JSF+Struts2 Integration ?
struts2: what kicks in first- the interceptors or the form's validation?
Struts2 Role Interceptor Help
struts2 + interceptor
Jsp is not displaying in Struts2