aspose file tools*
The moose likes Struts and the fly likes Getting the following Exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Getting the following Exception" Watch "Getting the following Exception" New topic
Author

Getting the following Exception

yerra reddy gatla
Greenhorn

Joined: Apr 25, 2006
Posts: 25
HTTP Status 500 - No action instance for path /vendorSearch could be created

--------------------------------------------------------------------------------

type Status report

message No action instance for path /vendorSearch could be created

description The server encountered an internal error (No action instance for path /vendorSearch could be created) that prevented it from fulfilling this request.


--------------------------------------------------------------------------------

Apache Tomcat/5.0.28


I am giving action in javascript.

Can anybody please tell me what might be the problem..

Thanks in advance

Regards
GYReddy
jayanandan thiagarajan
Greenhorn

Joined: Apr 27, 2006
Posts: 21
two things you have to check.
first thing :
check whether u use the normal html form action or struts form action.Coz,normal action dont do the extension of .do or .xx as u mentioned in the web.xml.
second thing :
check it in the struts-config.xml action-mappings.Whether u put the path and type correctly.
Otherwise give me details of ur form code.Really the error should be very minor .
I faced this probs alerady.
yerra reddy gatla
Greenhorn

Joined: Apr 25, 2006
Posts: 25
Hi Friend

My jsp code looks like...
_______________________________________________________________________
<form name="form1" method="post">
...........
............
<input type="button" name="searchButton" value="Search" onKlick="isEmail(this)" >
........
......
<input disabled size=9 name="addButton" type="button" value="Add" onKlick="addvalidation(this)">
..........
..........
<input disabled size=9 name="updateButton" type="button" value="Update" onKlick="addvalidation(this)" >

</form>
________________________________________________________________________

and in JavaScript file

______________________________________________________________________

function isEmail(button) {

if(validate())
{
alert("gyreddy");
document.forms[0].action = 'vendor'+ button.value +'.do';
document.forms[0].submit();
alert("gyreddy22222");
}
else
{
alert("invalid email");
}
}
________________________________________________________________

In Struts-config.xml
_______________________________________________________________
<form-beans>
<form-bean name="vendorform" type="com.vj.VendorFormBean"/>
</form-beans>
<action-mappings>
<action name="vendorform" path="/vendorSearch" input="VendorForm.jsp" scope="session" type="com.vj.action.VendorAction">
<forward name="success" path="/VendorForm.jsp"/>
</action>
<action name="vendorform" path="/vendorAdd" input="VendorForm.jsp" scope="session" type="com.vj.action.NewVendorAction">
<forward name="success" path="/VendorForm.jsp"/>
</action>
<action name="vendorform" path="/vendorUpdate" input="VendorForm.jsp" scope="session" type="com.vj.action.OldVendorAction">
<forward name="success" path="/VendorForm.jsp"/>
</action>
</action-mappings>
___________________________________________________________________

Actually Just please read my actual task and suggest me.

Please read patiently..

I have a JSP page in which I am searching for a record for the given emailid. For this,I have a search button. When user press SEARCH button by entering the emailid, It should call the javascript and do clientside validation for email.After validation, If a record exists with the given mailid, I am REGENERATING the same form again by displaying the corresponding record values in the textboxes below(name,phoneno,location etc). otherwise I have to give a new form.

After displaying the existing record for given mailid, I have to allow user to UPDATE or DELETE the record.. here I have to call javascript for UPDATE button..

If no record with the given(searching) mailid, I have to give a new form and the user can fill the form and ADD the record. Here I have to call Javascript again for the ADD button..

For this Iam trying to do write different action class for SEARCH,ADD,UPDATE buttons..I know there is other option DISPATCH ACTION,but with dispatch action,I think I can not call javascript.

After getting suggetions from JavaRanch friends I decided to write different action class for each button I have.

The thing is I completed the same task with general Jsp,servlet(web) application

Now I have to do it in struts..

can you please tell me Is this procedure correct? if it is OK tell me what might be the problem??

Thanks in advance for you suggestion

Regards
GYREDDY
yerra reddy gatla
Greenhorn

Joined: Apr 25, 2006
Posts: 25
Hi Friends,

can anybody please give the solution for the above question?

Any help would be greatly appreciated....

Regards
GYReddy
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
There may be a problem with your com.vj.action.VendorAction class. Verify that:

1-It Extends org.apache.struts.action.Action
2-It has a public, no-args constructor
3-It has an execute() method with the proper signature
4-The class file for it exists in WEB-INF/classes


Merrill
Consultant, Sima Solutions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Getting the following Exception