aspose file tools*
The moose likes Struts and the fly likes basic struts problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "basic struts problem" Watch "basic struts problem" New topic
Author

basic struts problem

saipraneeth nallapareddy
Ranch Hand

Joined: Dec 02, 2009
Posts: 159
hello everyone,

i am not a expertise in struts but have the idea about it's flow but that knowlege is not sufficent for me to get of the error i am facing.

the web.xml is


struts-config.xml is


the jsp is


when i click on the upload button i am getting the error that /upload.dav resource is not found, how to overcome this.
Krishna Madhava
Greenhorn

Joined: Sep 21, 2007
Posts: 11
Hi,

In your JSP, please replace the action name as /upload.do instead of upload.dav..

We can call struts actions by *.do not dav..

< body>
<h1>Upload</h1>
<form action="/upload.do"> // /upload.do instead of upload.dav
<input type="file" name="docName">
<input type="submit" value="Upload">
</form>

Hope it will resolve the issue...
Krishna Madhava
Greenhorn

Joined: Sep 21, 2007
Posts: 11
I Suggest you to try with struts-html tag libs in your JSP.

<%taglib uri="/WEB-INF/struts-html" prefix ="html"%>

<html:form action=' ...'>

<html:text type=' ' value=' '/>
</html:form>


Note : Kindly keep your struts-html.tld file inside your WEB-INF directory of your application...

saipraneeth nallapareddy
Ranch Hand

Joined: Dec 02, 2009
Posts: 159
i have placed the url patten in my struts configutation file as *.dav not *.do
Jaimesh M Ponkia
Greenhorn

Joined: Nov 24, 2010
Posts: 21
Change the form action to following:

<form action="<%=request.getContextPath()%>/upload.dav">

Also, don't forget to specify the enctype when using input type as file.
 
 
subject: basic struts problem