• 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

Error in Struts " Invalid path was requested"

 
Greenhorn
Posts: 8
Android jQuery Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello All,
Now I am trying my hands on struts. I have wriiten simple application in struts and it is yet to be complete.
Whenever I pass ajax request in struts it give me error "SEVERE: Invalid path /pages/login was requested".
I know I am making blunder somewhere please help me to figure it out.

1) web.xml file


2) struts-config.xml file


3) LoginAction.java file ( Action class )

4) index.jsp

Regards-
Ajinkya Parakh.
 
Ajinkya Parakh
Greenhorn
Posts: 8
Android jQuery Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"System.out.println(labName);" in LoginAction is not executed.
 
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
Welcome to JavaRanch! Please UseCodeTags when posting code or configuration. Unformatted code and configuration is unnecessarily difficult to read. You can edit your post by using the button.
 
Ajinkya Parakh
Greenhorn
Posts: 8
Android jQuery Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

David Newton wrote:Welcome to JavaRanch! Please UseCodeTags when posting code or configuration. Unformatted code and configuration is unnecessarily difficult to read. You can edit your post by using the button.



Thanks David. I have added the code tag. :)
 
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
This doesn't really have anything to do with Struts yet, so I'm moving it to HTML/JavaScript.

1) Why are you using the "new" keyword? You should just be setting xmlhttp to the results of calling the function.
2) Why are you doing Ajax "by hand"? Use a JavaScript framework--it will make you life *much* easier.
 
Ajinkya Parakh
Greenhorn
Posts: 8
Android jQuery Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks David I got it done. This was my first post on Javaranch
and really pleased by your prompt reply.
 
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
Glad we could help, and that you worked it out :)
 
Are we home yet? Wait, did we forget the tiny ad?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic