Struts2Action with Tomcat and Eclipse

Tomcat

You will need to add the following XML entry in order to use Tomcat Manager
/conf/tomcat-users.xml
<tomcat-users>
<role rolename="manager"/>
<user username="tomcat" password="tomcat" roles="manager"/>

You can use the XAMPP MySQL engine by making the following changes.
/WEB-INF/applicationContext.xml
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="org.gjt.mm.mysql.Driver" />
<property name="url" value="jdbc:mysql://127.0.0.1:3306/manning" />
<property name="username" value="root" />
<property name="password" value="root" />
</bean>

Point to a JDK of your choice and use the JAVA_OPTS variable to allow debugging in Eclipse.
/bin/startup.bat
SET JAVA_HOME=C:\java\jdk1.6.0_17
SET JAVA_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n

Eclipse

Add jar files for build from the following:

  • C:\tomcat\lib
  • C:\tomcat\webapps\Struts2InAction\WEB-INF\lib

Leave a Reply