• 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Struts2 struck with a issue of 404

 
Ranch Hand
Posts: 528
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
MY index.jsp page




MY struts.xml file:



I am getting 404 eroor (I have my HelloStruts2World class in my hello package also)

type Status report

message /HelloStruts2World/HelloStruts2World

description The requested resource (/HelloStruts2World/HelloStruts2World) is not available.


I am able to display my index page , after submit i get the above one.
Please tell me is there anything i need to change anywhere.
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you accessing the JSP page directly to get to the form? Have you verified the emitted HTML is correct? Can you access the action directly (i.e., not via form submission)?
 
RaviNada Kiran
Ranch Hand
Posts: 528
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using NetBeans as IDE . When i click Run on to the IDE:

This is the URL shown "http://localhost:8088/HelloStruts2World/"; on the browser.

And i get the JSP page displayed

and also when i type http://localhost:8088/HelloStruts2World/index.jsp

the page will be shown.
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you verified the emitted HTML is correct?

Accessing the JSP page directly will most likely *not* work; the S2 tags expect there to be a value stack available--I'm not sure that it would generate the appropriate HTML (but it might). It's generally best not to mix JSP/action access in a single application (and there's almost never a reason to anyway).
 
RaviNada Kiran
Ranch Hand
Posts: 528
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

David Newton wrote: Can you access the action directly (i.e., not via form submission)?



How can i check this ??



 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
...

Type in the URL of the action.
 
RaviNada Kiran
Ranch Hand
Posts: 528
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

David Newton wrote:...

Type in the URL of the action.



I tried that but same thing 404.

This is my whole index.jsp page:

 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So...

- you're deploying to the "/HelloStruts2World" context
- /HelloStruts2World/index.jsp *does* show the JSP.
- /HelloStruts2World/HelloStruts2World.action does *not* work?

Are there any errors on startup? Do you have devMode turned on and logging turned up? What libraries are you deploying?

You could also try setting your package's "namespace" attribute to "/" just to eliminate another possible source of error.
 
RaviNada Kiran
Ranch Hand
Posts: 528
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I already tried putting package names with

1. .

2. /

3. left it balnk also



 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The other questions I asked were important too. Might as well include your web.xml too to make sure the filter is set up correctly.
 
RaviNada Kiran
Ranch Hand
Posts: 528
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I extracted the war file created and checking everything . But for me everything seems okay.
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I wrote: Are there any errors on startup? Do you have devMode turned on and logging turned up? What libraries are you deploying?


Which version of S2 are you using?
 
RaviNada Kiran
Ranch Hand
Posts: 528
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

David Newton wrote:

I wrote: Are there any errors on startup? Do you have devMode turned on and logging turned up? What libraries are you deploying?



everthing is successful shown on IDE console , just checked server logs
I just checked everything on to server logs simply displaying




Which version of S2 are you using?



struts-2.0.14

I am using only 5 jar files commons-logging-1.0.4 , freemarker-2.3.8 , ognl-2.6.11 , struts2-core-2.0.14 , xwork-2.0.7
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I wrote:Are there any errors on startup? Do you have devMode turned on and logging turned up?

 
RaviNada Kiran
Ranch Hand
Posts: 528
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I just include <constant name="struts.devMode" value="true" /> this is struts.xml .But i don't know how this works .


Again nothing on server side logs.
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You should probably configure logging to include debug information from Struts and XWork; it's odd to see *nothing* on startup.
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have the same issues many times when I first used struts 2. You need to check your struts.xml, make sure everything in this file is correct, for instance, action names, action classes, global results, interceptors, maybe you typed some action strings in your action class but forgot to refer them in struts.xml.
You can remove some parts in struts.xml to test which part goes wrong.
 
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
where are your struts.xml located at?
is it in /WEB-INF/classes
 
Make yourself as serene as a flower, as a tree. And on wednesdays, as serene as this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic