7 Replies Latest reply on Jul 10, 2002 1:36 AM by balajikuduva

    Jetty and struts

    balajikuduva

      is it possible to run struts with jboss-jetty web server server ?

      if so, then what are the configuration files that has to be changed in jetty server?

      is it necessary to use "form bean" in each and every page we create using struts architecture?




        • 1. Re: Jetty and struts
          huijbrec

          Hi,

          See the Struts README:
          =====================
          - (*) Copy the files "lib/struts*.tld" from the Struts distribution into the
          "WEB-INF" directory of your web application.

          - (*) Copy the JAR files from the "lib" directory of the Struts distribution
          (such as "struts.jar" and "commons-*.jar") into the "WEB-INF/lib" directory
          of your web application.

          - (*) Modify your "WEB-INF/web.xml" file to include a element to
          define the controller servlet, and a <servlet-mapping> element to establish
          which request URIs are mapped to this servlet. Normally, you will map
          the controller servlet to a wildcard pattern ("/execute/*") or a filename
          extension pattern ("*.do"). Use the "WEB-INF/web.xml" file from the
          example application (see below) for an example of how this is done.

          - (*) Modify the "WEB-INF/web.xml" file for your web application to include
          a tag library declaration like this for each Struts tag library you will
          be using:


          <taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
          <taglib-location>/WEB-INF/struts-bean.tld</taglib-location>


          - Create a file "WEB-INF/struts-config.xml" that defines the mappings for your
          requests to specific action classes. Use the "struts-config.xml" file from
          the example application (see below) as a guide.

          - (*) In each JSP page that will use the Struts custom tags, add a line at
          the top of the page like this (for each Struts tag library needed):

          <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="struts-bean" %>

          (If you wish, you can use a prefix other that "struts-bean").

          - When compiling your web application components, be sure that the
          JAR files (copied above) are included on the CLASSPATH environment
          variable used by your Java compiler.


          About forms beans -see the struts user guide @
          http://jakarta.apache.org/struts/doc-1.0.2/userGuide/index.html

          rgds
          Rolf

          • 2. Re: Jetty and struts
            balajikuduva

            Dear rolf,

            Thanks a lot for the initial incentive given by you..
            my application is now recognizing struts ....

            but , if i use form beans the action mapping is not happening in the struts config.. nothing is displayed in the browser except the path.. \\application\login.do

            i have set web-inf.xml struts-conf.xml right..

            what might be the problem please help..

            with regards,
            balaji

            • 3. Re: Jetty and struts
              bleupen

              please post your config files.

              b

              • 4. Re: Jetty and struts
                balajikuduva

                hai ,

                this are the configuration files

                1.web.xml ( placed in WEB-INF\)
                ----------------------------------
                <web-app>

                <servlet-name>action</servlet-name>
                <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
                <init-param>
                <param-name>application</param-name>
                <param-value>ApplicationResources</param-value>
                </init-param>
                .......
                .......
                <servlet-mapping>
                <servlet-name>action</servlet-name>
                <url-pattern>*.action</url-pattern>
                </servlet-mapping>
                .....
                ....

                <taglib-uri>/WEB-INF/struts.tld</taglib-uri>
                <taglib-location>/WEB-INF/struts.tld</taglib-location>


                <taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
                <taglib-location>/WEB-INF/struts-bean.tld</taglib-location>

                .....
                </web-app>
                ------------------------------------------------
                2.struts-conf.xml ( placed in WEB-INF\)
                .......
                <action-mappings>




                </action-mappings>
                .....
                -----------------------------------

                3. the jsp page(loginBack.jsp) calling action

                <%@ page language="java" %>
                <%@ page import="java.util.*"%>
                <%@ page import="TSIPack.logic.*"%>
                <%@ page import="TSIPack.view.*"%>
                <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
                <%@ taglib uri="/WEB-INF/struts-form.tld" prefix="form" %>
                <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>




                ...............
                .............
                ................
                this will have a text user name and password..
                and a submit button..
                ------------------------------------------------

                4. this is the path where i am calling th action servlet
                -------------------------------------------------------
                /home/jboss-3.0.0/server/default/deploy/TSI.war/WEB-INF/classes/TSIPack/actions/
                ----------------------------------------------------

                currently i am using jboss 3 verson

                please help me.

                • 5. Re: Jetty and struts
                  bleupen

                  balajikuduva,

                  hey. please show me the URL you are typing into your browser to get to the loginBack.jsp page.

                  b

                  • 6. Re: Jetty and struts
                    balajikuduva

                    dear bleupen,

                    the url is
                    http://172.18.100.3:8080/TSI/loginBack.jsp

                    after clicking the submit button in loginBack.jsp the URL shows

                    http://172.18.100.3:8080/TSI/login.action

                    this is the output of the server
                    09:36:37,917 INFO [Jetty] action: Processing a POST for /login
                    09:36:40,190 INFO [Jetty] action: No mapping available for path /login

                    and i have set the context root as TSI
                    in
                    jboss-web.xml ( placed in WEVB-INF\)
                    --------------------------------------------
                    <?xml version="1.0" encoding="UTF-8"?>
                    <jboss-web>
                    <context-root>TSI</context-root>
                    </jboss-web>
                    -----------------------------------------------

                    what might be the problem bleupen...

                    • 7. Re: Jetty and struts
                      balajikuduva

                      dear bleupen,

                      this is different application running on (struts jboss jetty) verson 3 the browser says the error if i call some action

                      HTTP ERROR: 500 /Scheme/SchemeDepotPeriodInput.jsp(122,69) Attribute value should be quoted

                      RequestURI=/crm/schEvaluateStep1.action

                      what is this error ...