This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes how to work on struts using eclipse? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "how to work on struts using eclipse?" Watch "how to work on struts using eclipse?" New topic
Author

how to work on struts using eclipse?

Aditi Gandy
Ranch Hand

Joined: Apr 23, 2008
Posts: 37
Hi, I am new to struts. I am using struts2 and eclipse 3.2. I wanted to work strus using eclipse. How do i do that? how to add plugins to eclipse?

can any one please help me?

Regards,
Ashvini


Thanks & Regards,
Author
Nishan Patel
Ranch Hand

Joined: Sep 07, 2008
Posts: 684

Hi,

First of all there is one plug-in for Struts 2 development.

But it is better to create configuration by own.
with Struts 2 it is very easy to configure it.

Please make sure your web xml loos like,

<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_9" version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>Print Everywhere</display-name>

<filter>
<filter-name>struts-cleanup</filter-name>
<filter-class>
org.apache.struts2.dispatcher.ActionContextCleanUp
</filter-class>
</filter>

<filter>
<filter-name>struts2</filter-name>
<filter-class>
com.printeverywhere.util.StrutsFilterDispacher
</filter-class>
</filter>

<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<error-page>
<error-code>404</error-code>
<location>/index.htm</location>
</error-page>

</web-app>


Please Make sure you have include six jar for basic Struts 2.0 Application.
1 ) struts2-core-2.1.2
2 ) xwork-2.1.1
3 ) freemarker-2.3.12
4 ) ognl-2.6.11
5 ) commons-collections-3.2
6 ) commons-logging-1.1


And you have to Create on struts.xml at src folder.

And write configuration for thjis.

For reference See struts site.


Thanks, Nishan Patel
SCJP 1.5, SCWCD 1.5, OCPJWSD Java Developer,My Blog
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

@Nishan: you seem to have advised the original poster to use a custom filter dispatcher.
Nishan Patel
Ranch Hand

Joined: Sep 07, 2008
Posts: 684

Hi,

Use this web.xml instead of above mention.


<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_9" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

<display-name>Struts Hibernate</display-name>

<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>

<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
Aditi Gandy
Ranch Hand

Joined: Apr 23, 2008
Posts: 37
Thank you every one for your guidence.

Thanks a ton
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to work on struts using eclipse?
 
Similar Threads
web application debugging
Struts 2 plugin for eclipse
How to Configure Struts with Eclipse
plugins to make eclipse struts enabled
struts app exception