Results 1 to 8 of 8

Thread: Tomcat with struts

  1. #1
    Registered Member
    Join Date
    Jul 2002
    Posts
    52

    Default Tomcat with struts

    Hello,

    Im checking to see if any of you guys who successfully got tomcat working were able to use the struts framework.

    Thanks in advance!

    -John

  2. #2
    Moderator cPanel Partner NOC Badge dgbaker's Avatar
    Join Date
    Sep 2002
    Location
    Toronto, Ontario Canada
    Posts
    2,779

    Default

    You would have a very hard time I would think, because the Tomcat 4.0 web connector is still under development for struts.
    Regards,
    David
    Forum Moderator

  3. #3
    Registered Member
    Join Date
    Jul 2002
    Posts
    52

    Default

    Can you explain to me what is required to get struts to work?
    Im not a jsp developer, but ive worked with tomcat on server in the past so.. if you can guide me in the right direction id appreciate it!

    -John

  4. #4
    Moderator cPanel Partner NOC Badge dgbaker's Avatar
    Join Date
    Sep 2002
    Location
    Toronto, Ontario Canada
    Posts
    2,779

    Default

    Since I haven't got it working with 4.0.3 either, the best suggestion would be to look at sites like http://www.jguru.com/forums/Struts & http://jakarta.apache.org/struts/

    They say it will work with 4.0 (not sure on 4.0.3) using the src of struts but I keep running in to compile issues with struts GenericConnection.java

    So if you find out let us all know.
    Regards,
    David
    Forum Moderator

  5. #5
    Registered Member
    Join Date
    Jul 2002
    Posts
    52

    Default

    My customer's comments:

    You don't have to have struts installed as a globally available framework. Struts is nothing but a set of classes, which can be very well something I developed with my classes. So, everything can be bundled together under one webapp. There is no need for a webconnector specially designed for struts. Struts does not use any proprietery technology. As long as we can call up servlets (not just jsp pages), we should be fine.

    Does this shed some light on the subject?

    -John

  6. #6
    Moderator cPanel Partner NOC Badge dgbaker's Avatar
    Join Date
    Sep 2002
    Location
    Toronto, Ontario Canada
    Posts
    2,779

    Default

    Not really cause with 4.0.3 when you try to deploy the war files it does unpack them BUT, the tomcat-apache.conf file that is suppossed to be created does not get created and hence you cannot make the necessay changes to apache (required). Here is all of the install info for struts from their install doc.

    TOMCAT 3.1 (OR LATER) WITH APACHE
    ---------------------------------

    * These instructions assume you have successfully integrated
    Tomcat with Apache according to the Tomcat documentation.

    * Copy &struts-documentation.war& and &struts-example.war&
    to your $TOMCAT_HOME/webapps directory

    * Restart Tomcat if it is already running

    * Tomcat will generate a file &$TOMCAT_HOME/conf/tomcat-apache.conf&
    that will be used by Apache. This file is regenerated every time
    you start Tomcat, so copy this file to a safe place (such as
    your Apache configuration directory; on Unix systems this is usually
    &/usr/local/apache/conf&.

    * If you are running Tomcat 3.1, Tomcat will not have generated the
    entries for your new applications. Add the following lines to the
    &tomcat-apache.conf& file that you have saved, replacing
    $TOMCAT_HOME with the path to your Tomcat home directory:

    Alias /struts-documentation &$TOMCAT_HOME/webapps/struts-documentation&
    &Directory &$TOMCAT_HOME/webapps/struts-documentation&
    Options Indexes FollowSymLinks
    &/Directory&
    ApJServMount /struts-documentation/servlet /struts-documentation
    &Location &/struts-documentation/WEB-INF/&&
    AllowOverride None
    deny from all
    &/Location&

    Alias /struts-example &$TOMCAT_HOME/webapps/struts-example&
    &Directory &$TOMCAT_HOME/webapps/struts-example&
    Options Indexes FollowSymLinks
    &/Directory&
    ApJServMount /struts-example/servlet /struts-example
    &Location &/struts-example/WEB-INF/&&
    AllowOverride None
    deny from all
    &/Location&

    * On all versions of Tomcat, the generated file above does not
    know anything about extension mappings defined in a web.xml file,
    so the &*.do& URIs that go to the controller servlet will not be
    recognized. To fix this, add the following line to the saved
    version of &tomcat-apache.conf&, after the corresponding line
    for the .jsp extension:

    AddHandler jserv-servlet .do

    * Ensure that the saved version of &tomcat-apache.conf& is referenced
    in your Apache &httpd.conf& configuration file. A typical use would
    have the following line at the bottom of &httpd.conf&:

    Include /usr/local/apache/conf/tomcat-apache.conf

    * In order to recognize &index.jsp& as a default page for web
    applications, search in your &httpd.conf& for a &DirectoryIndex&
    directive. If you have one, add &index.jsp& to the end of the
    list, so that it might look like this:

    DirectoryIndex index.html index.jsp

    If you do not have such an entry, add one like this:

    DirectoryIndex index.jsp

    * Restart Apache to make it aware of the new applications. You should
    now be able to access the applications from a browser like this:

    http://localhost/struts-documentation
    http://localhost/struts-example



    Best I can do for you, as this does not work on 4.0.3 as certain things do not happen as the are suppossed to.
    Regards,
    David
    Forum Moderator

  7. #7
    Registered Member casey's Avatar
    Join Date
    Jan 2003
    Location
    If there is trouble, it will find me
    Posts
    2,333

    Default

    I don't know about any new advancements since this thread, but I used the code in the following thread to enable .do files, and my customer is happy as can be.
    Struts / Tomcat question

    I didn't do anything except put that code in his virtualhost entry and he did all else himself. I can't swear that it works flawlessly, because I haven't and don't want to ask. As long as he's happy I'm happy.

  8. #8
    Registered Member
    Join Date
    Jul 2002
    Location
    Atlanta, GA
    Posts
    649

    Default

    Struts works just fine on Tomcat 4.0. It's as application framework, not a server framework, so each user must have their own jars.

    The one big problem I see here is directions for mod_jserv are being posted and everyone seems to be failing to realize they are probably using mod_jk.

    Pass the right mount directives and you're all set.

Similar Threads

  1. struts issue
    By nitaish in forum cPanel & WHM Discussions
    Replies: 3
    Last Post: 10-25-2010, 01:25 AM
  2. Struts / Tomcat question
    By Mivo in forum cPanel & WHM Discussions
    Replies: 4
    Last Post: 06-18-2008, 11:11 AM
  3. Tomcat / Struts
    By Secret Agent in forum cPanel & WHM Discussions
    Replies: 2
    Last Post: 06-16-2008, 04:09 PM
  4. Java Struts and Tomcat support
    By nitaish in forum cPanel & WHM Discussions
    Replies: 0
    Last Post: 07-07-2006, 05:33 AM
  5. Tomcat & Struts
    By Secret Agent in forum cPanel & WHM Discussions
    Replies: 1
    Last Post: 12-26-2005, 05:07 PM
bargain