• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to practice struts in Eclipse

 
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I am new to Struts. I want to practice Struts in Eclipse. I am reading Struts in Action book. What are the steps I have to do to download and to configure with Eclipse.

Thanks in advance,
sudha.
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just download the latest version of Eclipse Europa, making sure to select the option "Eclipse IDE for Java EE Developers". Then download the latest version of Struts 1, which is currently version 1.3.8 from the Struts home page and unzip it. Then all you have to do is import the struts-blank-1.3.8.war file that comes with the download into eclipse and you have a Struts application set up in eclipse that you can then add elments to.

Before you can test your application in Eclipse, you will have to set up an application server such as Tomcat and then configure Eclipse so that it knows where the server is. If you don't know how to do this, consult the Eclipse help documentation.
 
sudha javvadi
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Merill,

Thank you for your response. I have downloaded Eclipse and configured with Tomcat 6. I did some servlets and JSP prgrams on that. Can you tell me how to import Struts into Eclipse, and how to set up a Struts application in Eclipse.

Thank you in advance,
Sudha.
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
File->Import->Web->War File. Click the next button and browse for the struts-blank-1.3.8.war file that came with your Struts download. Select Tomcat as the target runtime and click Finish. You now have a Struts project with all the essential elements.
 
sudha javvadi
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Merrill,

I successfully downloaded and configured struts with eclipse as you told. Now I want to test it. where I need to store my jsp's and Action classes?As per my knowledge, Jsp's go under pages folder and Action classes go under build->classes. correct me if I am wrong.

thank you.
sudha.
 
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi suddha,

you just click help in eclipse..then type "struts" in search column..
Enter...then you will get the aa details with small example program..

Hope that will help you

thanks & regards,
seetharaman
 
sudha javvadi
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi seetharam,

I got nothing found when I searched in eclipse help.
could you please guide me where to put my Jsp's, action forms and action classes.

thanks
sudha.
 
sudha javvadi
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I downloaded struts1.3.8 and configured struts-blank.war with eclipse IDE.Under JavaResources:src i created a package named actions and I created an action class.Under pages folder(came along with struts-blank.war) I created an Jsp page.I dont know how to use Ant. I came to know that struts ships with ant build.xml file,but I didn't see anything under Web-Inf/src.what i have to do to run my first application?

Thanks in advance,
sudha.
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You don't need Ant to deploy and run a Struts project in Eclipse.

Once you've imported the struts-blank war file, deploying and running a Struts application in Eclipse is no different than deploying and running any other web application from Eclipse.

If you don't know how to deploy and run a web application from Eclipse, you will have to spend some time getting familiar with the Eclipse Web tools. The best way to do this is to read the Eclipse help documentation. I'd suggest you read the entire section: Web Application Development User Guide->Using the Server tools->Application Testing and Publishing.
[ April 24, 2008: Message edited by: Merrill Higginson ]
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Merrill Higginson wrote:File->Import->Web->War File. Click the next button and browse for the struts-blank-1.3.8.war file that came with your Struts download. Select Tomcat as the target runtime and click Finish. You now have a Struts project with all the essential elements.






when i import struts-blank.war file from jakarata-struts-1.1, i am getting an error in validation.xml,
which is there in WEB-INF folder, can any one help out


validation.xml :-

<?xml version="1.0" encoding="ISO-8859-1" ?>

<!DOCTYPE form-validation PUBLIC
"-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.0//EN"
"http://jakarta.apache.org/commons/dtds/validator_1_0.dtd">

<form-validation>

<!--
This is a blank Validator form file with a commented examples.
-->

<global>

<!-- An example global constant
<constant>
<constant-name>postalCode</constant-name>
<constant-value>^\d{5}\d*$</constant-value>
</constant>
end example-->

</global>

<formset> i got err in this line stating that-->the content element type “formset” is incomplete,it must match “(constant *,form+)”

<!-- An example form
<form name="logonForm">
<field
property="username"
depends="required">
<arg0 key="logonForm.username"/>
</field>
<field
property="password"
depends="required,mask">
<arg0 key="logonForm.password"/>
<var>
<var-name>mask</var-name>
<var-value>^[0-9a-zA-Z]*$</var-value>
</var>
</field>
</form>
end example form -->

</formset>

<!-- An example formset for another locale
<formset language="fr">

<constant>
<constant-name>postalCode</constant-name>
<constant-value>^[0-9a-zA-Z]*$</constant-value>
</constant>

</formset>
-->

</form-validation>

what mistake i have done.?
can any one help me out.

thanks in advance
Daya
 
reply
    Bookmark Topic Watch Topic
  • New Topic