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

Struts Basic question

Prannav Santhosh
Greenhorn

Joined: May 09, 2009
Posts: 29
Hi,
I have a welcome.jsp (as shown below)

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<html:form action="/Data" method="post" >
</html:form>
</body>
</html>

In the struts config.xml , I have the below entry.

<form-beans>
<form-bean name="dataForm" type="com.forms.DataForm">
</form-bean>
</form-beans>

<action-mappings>
<action path="/Data" type="com.actions.DataAction" name="dataForm">
<forward name="success" path="/Success.jsp"></forward>
</action>
</action-mappings>
The question here is , when i type in the http://localhost:9080/<webcontext>/welcome.jsp , will the DataForm object be created ?
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8964
    
    9

No. If you use a URL with .jsp, you are going around the Struts framework and going right to the JSP. To go through Struts, you will have to use a URL that matches the mapping you configured in web.xml, usually (but not necessarily) something ending in .do


[How To Ask Questions On JavaRanch]
Prannav Santhosh
Greenhorn

Joined: May 09, 2009
Posts: 29
Joe- thanks for your time..
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts Basic question