• 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

Servlet Action not found

 
Ranch Hand
Posts: 44
Firefox Browser VI Editor Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Is there any thing wrong in this xml file?

My HelloForm.java extends Action Form class and it is in "proj/WEB-INF/classes/com/test/"

My HelloWorldA.java is in "proj/WEB-INF/classes/com/"
 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
According to your struts-config file,
--your form action on jsp should be action="/helloWorld"
--your action class HelloWorld.java should be in com package and must extend org.apache.struts.action.Action class.
Please check above two points.
 
Ranch Hand
Posts: 41
Eclipse IDE Firefox Browser Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The error stacktrace and JSP in question would be helpful. Also make sure you've done enough debugging before starting a thread for a problem. Like I said before, try understanding a working Struts application if you face issues with your app.
 
manikandan jayakumar
Ranch Hand
Posts: 44
Firefox Browser VI Editor Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If I use the code

in my index page 'm getting the error
The requested resource (/helloWorld) is not available.
if i use helloWorld.do in place of /helloWorld
'm getting Servlet Action not found
 
Ravishanker kumar
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
if you use struts tag, you can use simply, <html:form action="/helloWorld"...> struts tag does required conversion for you.
if you are use html tag you have to use <form action="/helloWorld.do"...>
Have you checked that your action class extending org.apache.struts.action.Action class. If this part is also ok, Please provide all files to find out the root cause.

~Ravi
 
manikandan jayakumar
Ranch Hand
Posts: 44
Firefox Browser VI Editor Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
index.jsp:


struts-config.xml

web.xml


HelloWorldA.java(proj/WEB-INF/classes/com/)


HelloForm.java(proj/WEB-INF/classes/com/test)

helloWorld.jsp


 
manikandan jayakumar
Ranch Hand
Posts: 44
Firefox Browser VI Editor Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
After i restarted my server there is no error but not getting the correct answer
it just displaying 0 0 0 0 0 0
instead of name,mark1,mark2....mark5.
WARNING : No FormBeanConfig found in module under name name
 
manikandan jayakumar
Ranch Hand
Posts: 44
Firefox Browser VI Editor Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Finally 'm in state not getting the result just zeros instead of values

INFO: initialize action of type: com.HElloWorldA
 
Ravishanker kumar
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You are also using array in action form incorrectly. please try on google for this
 
manikandan jayakumar
Ranch Hand
Posts: 44
Firefox Browser VI Editor Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Even after changed the array into 5 int variables,
not getting the required result.
All were zeros:
Warning: No BenFormConfig found in module under name name
INFO: Initialize action of type: com.HelloWorldA
 
Orton K Randy
Ranch Hand
Posts: 41
Eclipse IDE Firefox Browser Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is your form-bean declaration still commented in struts-config?

 
manikandan jayakumar
Ranch Hand
Posts: 44
Firefox Browser VI Editor Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Randy,
Now 'm using

'm just getting zeros!!!
 
manikandan jayakumar
Ranch Hand
Posts: 44
Firefox Browser VI Editor Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Would it be the cause for my error
'm using helloForm as ActionForm it is in (../classes/com/test/)
used as a package

package test;

so that i can import the package in my Action class which is in (...classes/com/)

but i declared this as

package com;
 
Orton K Randy
Ranch Hand
Posts: 41
Eclipse IDE Firefox Browser Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Watch out for the case of the method names especially the getters in your form. They're NOT in camelCase! And your ActionForm pacjage declaration should have been:

Also post the entire error stacktrace if you get an error again.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic