File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts 2 Filter mapping Issue

 
Sugantha Jeevankumar
Ranch Hand
Posts: 93
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Punit Singh
Ranch Hand
Posts: 952
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


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.
 
Sugantha Jeevankumar
Ranch Hand
Posts: 93
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 93
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can somebody help me out... I am lost at the moment.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic