Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error in Struts " Invalid path was requested"

 
Ajinkya Parakh
Greenhorn
Posts: 8
Android Java jQuery
  • 0
  • Mark post as helpful
  • send pies
  • 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 Java jQuery
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"System.out.println(labName);" in LoginAction is not executed.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • 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 Java jQuery
  • 0
  • Mark post as helpful
  • send pies
  • 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
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • 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 Java jQuery
  • 0
  • Mark post as helpful
  • send pies
  • 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
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Glad we could help, and that you worked it out :)
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic