• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Struts 2 Filter mapping Issue

 
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 952
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can somebody help me out... I am lost at the moment.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic