- This topic has 4 replies, 3 voices, and was last updated 20 years ago by tester333.
-
AuthorPosts
-
tester333MemberHi,
I have enabled Struts using Myecliseide function “add struts capabilities”. The result is the library files and configuration files are all added.
However, after defining the action and include the existing jsp input pages with it’s corresponding output jsp page upon success submission, what else is needed to be done to make the forwarding work ?
1. To be more specific, what do I need to change for the existing action=”” in the form tag ?
2. My current jsp page is simple ones. Is it neccessary to convert it to struts form page format ? If so how ?
Thanks.
kbroderiMemberI think that you’ll need to set the action in the existing form to whatever the action is you defined in
the struts-config.xml. As far as I know, you won’t have to change the form, just the action target.
Check out the tutorial here, very useful if a little outdated: http://www.reumann.net/struts/main.do
Cheers,
Kev
Scott AndersonParticipantKev,
Thanks for the pointer to the tutorial! We also have a Struts tutorial of our own in the Documentation section here:
http://www.myeclipseide.com/ContentExpress-display-ceid-67.html, if that helps also.
tester333MemberHi,
What bothers me is this:
1. The examples that i have read has jsp files using tags for all the
control objects in the form. Below is an example of what i mean:<html:form action=”insertEmployee” focus=”name”>
My existing jsp file does not use the format as above. This is how i setup my jsp application:
<form action=”response.jsp”>
2. I also noticed that on top of every struts page there is a set of declaration as below:
<%@ taglib uri=”struts/bean-el” prefix=”bean” %>
<%@ taglib uri=”struts/html-el” prefix=”html” %>Now, my question is do I need to convert all my simple jsp file to take the same tag-based format in order to use the struts framework ?
Thanks.
tester333Member@tester333 wrote:
Hi,
What bothers me is this:
1. The examples that i have read has jsp files using tags for all the
control objects in the form. Below is an example of what i mean:<html:form action=”insertEmployee” focus=”name”>
My existing jsp file does not use the format as above. This is how i setup my jsp application:
<form action=”response.jsp”>
2. I also noticed that on top of every struts page there is a set of declaration as below:
<%@ taglib uri=”struts/bean-el” prefix=”bean” %>
<%@ taglib uri=”struts/html-el” prefix=”html” %>Now, my question is do I need to convert all my simple jsp file to take the same tag-based format in order to use the struts framework ?
Thanks.
I also noticed that in jbuilder there is a jsp conversion function that converts the simple jsp file to struts jsp page with all the above tags as mentioned above.
It is natural that I am wondering if this is the pre-requisite to enabling struts more than simply “add strusts capabilities” to the application. Adding the struts capabilities function merely adds the *.jar ,*.tld,config files and insert the relevant action declarations in the web.xml.
There is no mention of converting the simple jsp pages to struts jsp pages.
The reason I brought this up is because by simply enabling the “add struts capabilities” to my application has resulted in the relevant libraries, tag libraries, etc added to my application. What it does not do is to have my application work as before adding the struts capabilities.
There is probably something else i need to do ?( such as changing the <form action=”something.do”> ? )
-
AuthorPosts