File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts Basic question" Watch "Struts Basic question" New topic

Struts Basic question

Prannav Santhosh

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

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

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

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

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

Joined: Oct 29, 2001
Posts: 9168

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

Joined: May 09, 2009
Posts: 29
Joe- thanks for your time..
It is sorta covered in the JavaRanch Style Guide.
subject: Struts Basic question
It's not a secret anymore!