Struts : How is one supposed to write a .jsp - Weblogic

This is a discussion on Struts : How is one supposed to write a .jsp - Weblogic ; Hello, I have the following files below. Basically, all I am trying to do is to get *1* form to call the contents of the action form. All I keep getting is: "The requested resource (/action.do) is not available" BTW, ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: Struts : How is one supposed to write a .jsp

  1. Struts : How is one supposed to write a .jsp

    Hello,

    I have the following files below. Basically, all I am trying to do is
    to get *1* form to call the contents of the action form. All I keep
    getting is:

    "The requested resource (/action.do) is not available"

    BTW, the .xml config file was generated by a product called Exadel - as
    an FYI - Beware ....

    Why do I keep getting the error? I just would like to know for my own
    understanding ... I thought I did everything right (doc - concerned).
    Is the information generated by the program (Exadel) wrong?

    Kindest Regards.

    /* CVS information: $Revision: 1.1.1.1 $ $Date: 2003/05/05 23:38:50 $
    * $Source: /cvs-master/Exadel4_6/tomcat/LICENSE,v $
    * $Author: sorits $
    */

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


















     
















    System Login ID

            


    Social Security Number

            
    name="FilerSocSecNo">




    value=" Continue " name="Continue">






    /*
    * socsecnoAction.java
    *
    * Generated on Tue Jan 25 11:40:24 PST 2005
    * by Exadel Struts Studio
    */

    package taxes;

    import java.io.*;
    import javax.servlet.RequestDispatcher;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.http.HttpSession;
    import org.apache.struts.action.Action;
    import org.apache.struts.action.ActionError;
    import org.apache.struts.action.ActionErrors;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionForward;
    import org.apache.struts.action.ActionMapping;
    import org.apache.struts.action.ActionServlet;
    import org.apache.struts.action.DynaActionForm;
    import org.apache.struts.util.MessageResources;

    public class socsecnoAction extends org.apache.struts.action.Action {

    public static final String GLOBAL_FORWARD_StartTaxes =
    "StartTaxes";

    // Global Forwards
    public static final String GLOBAL_FORWARD_getName = "getName";

    public socsecnoAction() {
    // TODO: Write constructor body
    }

    public ActionForward execute(ActionMapping mapping, ActionForm
    form, HttpServletRequest request, HttpServletResponse response) throws
    Exception {
    // TODO: Write method body
    throw new UnsupportedOperationException("Method not
    implemented");
    }
    }
    /*
    * socsecnoActionForm.java
    *
    * Generated on Mon Jan 24 05:33:26 PST 2005
    * by Exadel Struts Studio
    */

    package taxes;

    import java.io.*;
    import javax.servlet.RequestDispatcher;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.http.HttpSession;
    import org.apache.struts.action.Action;
    import org.apache.struts.action.ActionError;
    import org.apache.struts.action.ActionErrors;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionForward;
    import org.apache.struts.action.ActionMapping;
    import org.apache.struts.action.ActionServlet;
    import org.apache.struts.action.DynaActionForm;
    import org.apache.struts.util.MessageResources;
    import org.apache.log4j.Logger;

    public class socsecnoActionForm extends
    org.apache.struts.action.ActionForm {

    private AtomFDep[] FDepList;
    private FDep FDepQueryList;
    private AtomFDep FDepDataQuery = new AtomFDep();

    private int max, i;

    private static Logger logger = Logger.getLogger("rfc.pattern");



    public int load_data() {
    logger.info("got inside");





    FDepList = new AtomFDep[max];
    for (i = 0; i < max; i++) {
    logger.info("got one item "+ i);
    FDepList[i] = (AtomFDep) FDepQueryList.getRow(i);
    }
    logger.info(FDepList[1].getFilerSocSecNo() );

    return 0;
    }



    public String getProcID() {
    return this.ProcID;

    }

    public void setProcID(String inString) {
    ProcID = inString;

    }

    public String getFilerSocSecNo() {
    return this.FilerSocSecNo;

    }

    public void setFilerSocSecNo(String inString) {
    FilerSocSecNo = inString;
    load_data();
    }

    // Global Forwards
    public static final String GLOBAL_FORWARD_getName = "getName";

    // Local Forwards
    private static final String FORWARD_ques = "ques";

    public socsecnoActionForm() {
    // TODO: Write constructor body
    }

    public ActionForward execute(ActionMapping mapping, ActionForm
    form, HttpServletRequest request, HttpServletResponse response) throws
    Exception {
    // TODO: Write method body
    throw new UnsupportedOperationException("Method not
    implemented");
    }
    }


    PATH="/pages/inputname.jsp" SHAPE="19,254,110,27" TARGET="page0"
    TITLE="getName" TYPE="forward"/>
    PATH="/greeting" SHAPE="167,320,110,30" TITLE="GetNameForm"
    TYPE="action"/>
    PATH="/pages/inputname.jsp" SHAPE="224,260,55,30" SUBTYPE="jsp"
    TITLE="inputname.jsp" TYPE="page"/>
    PATH="/pages/greeting.jsp" SHAPE="438,322,55,30" SUBTYPE="jsp"
    TITLE="greeting.jsp" TYPE="page"/>
    PATH="/taxes.do" SHAPE="298,307,110,44" TITLE="DependentsProcForm"
    TYPE="action">
    NAME="forward0" PATH="/pages/greeting.jsp" TARGET="page1"
    TITLE="greeting" TYPE="forward"/>

    PATH="/pages/dependents.jsp" SHAPE="23,300,55,30" SUBTYPE="jsp"
    TITLE="dependents.jsp" TYPE="page"/>
    PATH="/pages/testtaxinp.jsp" SHAPE="391,238,55,30" SUBTYPE="jsp"
    TITLE="testtaxinp.jsp" TYPE="page"/>
    PATH="/pages/Ques.jsp" SHAPE="621,313,55,30" SUBTYPE="jsp"
    TITLE="Ques.jsp" TYPE="page"/>
    PATH="/pages/socsecno.jsp" SHAPE="183,36,55,30" SUBTYPE="jsp"
    TITLE="socsecno.jsp" TYPE="page"/>
    NAME="forward1" PATH="/pages/socsecno.jsp" SHAPE="43,36,110,27"
    TARGET="page5" TITLE="StartTaxes" TYPE="forward"/>
    PATH="/pages/PrintTaxVals.jsp" SHAPE="549,63,55,30" SUBTYPE="jsp"
    TITLE="PrintTaxVals.jsp" TYPE="page"/>
    PATH="/action" SHAPE="84,159,149,30" TITLE="socsecnoAction"
    TYPE="action"/>
    PATH="/pages/Dependents.jsp" SHAPE="444,159,0,0" SUBTYPE="jsp"
    TITLE="Dependents.jsp" TYPE="page"/>


    Struts Configuration 1.1//EN"

    "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">







    type="taxes.socsecnoActionForm"/>







    type="demo.GreetingAction"/>
    type="taxes.DependentsAction" unknown="false">


    type="taxes.socsecnoAction"/>





  2. Re: Struts : How is one supposed to write a .jsp

    On 25 Jan 2005 16:56:13 -0800, "milkyway"
    wrote:

    >
    >
    >
    >
    >
    >
    >

    ^^^^^^^^^^^^^
    Don't need a form bean called socsecnoAction. That's your Form name.

    > >type="taxes.socsecnoActionForm"/>
    >
    >
    >
    >
    >
    >

    >
    > >type="demo.GreetingAction"/>
    > >type="taxes.DependentsAction" unknown="false">
    >
    >

    > >type="taxes.socsecnoAction"/>


    try:
    type="taxes.socsecnoAction"/>

    >
    >
    >



    In your HTML form, you 'd specify:
    action="/action.do"

    See, in the Struts config file, things are kinda named funny. In the
    Action element, the name refers to the associated Form Bean
    declaration, and the path is what the incoming request matches...

    A quick word of advise. If you are just learning Struts, I HIGHLY
    recommend you look at some tutorials that walk you through creating
    all the files by hand, as opposed to using a tool like Exadel. Those
    tools are nice, but it really helps to understand what its generating.

    --
    now with more cowbell

  3. Re: Struts : How is one supposed to write a .jsp

    Wait a miniute... You said this was supposed to be a JSP? See my
    comments below

    On 25 Jan 2005 16:56:13 -0800, "milkyway"
    wrote:

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


    Taglib delcaration. Is this a JSP? If so, why aren't you using any of
    the Struts HTML tags?

    >
    >
    >
    >
    >
    >
    >
    >
    >
    >
    >
    >
    >
    >
    >

    >



    --
    now with more cowbell

  4. Re: Struts : How is one supposed to write a .jsp

    Thank you for your responses :-)

    I did as advised (reading and more research) and found the problems
    with my code. It was with the naming conventions.


+ Reply to Thread