facebook

Wierd Problem

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #241089 Reply

    vdatt
    Member

    I created new simple J2ee webproject in My eclipse with struts capabilitieslatest version.

    LoginForm, LoginAction.java,login.jsp,success.jsp. page.

    LoginForm

    package com.bms.struts.form;

    import javax.servlet.http.HttpServletRequest;

    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionMapping;

    /**
    * MyEclipse Struts
    * Creation date: 11-07-2005
    *
    * XDoclet definition:
    * @struts.form name=”loginForm”
    */
    public class LoginForm extends ActionForm {

    // ——————————————————— Instance Variables

    /** password property */
    private String password;

    /** userName property */
    private String userName;

    // ——————————————————— Methods

    /**
    * Method reset
    * @param mapping
    * @param request
    */
    public void reset(ActionMapping mapping, HttpServletRequest request) {

    // TODO Auto-generated method stub
    }

    /**
    * Returns the password.
    * @return String
    */
    public String getPassword() {
    return password;
    }

    /**
    * Set the password.
    * @param password The password to set
    */
    public void setPassword(String password) {
    this.password = password;
    }

    /**
    * Returns the userName.
    * @return String
    */
    public String getUserName() {
    return userName;
    }

    /**
    * Set the userName.
    * @param userName The userName to set
    */
    public void setUserName(String userName) {
    this.userName = userName;
    }

    }

    login.jsp

    <%@ page language=”java”%>
    <%@ taglib uri=”http://jakarta.apache.org/struts/tags-bean&#8221; prefix=”bean”%>
    <%@ taglib uri=”http://jakarta.apache.org/struts/tags-html&#8221; prefix=”html”%>

    <html>
    <head>
    <title>JSP for loginForm form</title>
    </head>
    <body>
    <html:form action=”login”>
    <html:submit/><html:cancel/>
    </html:form>
    </body>
    </html>

    package com.bms.struts.action;

    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;

    import org.apache.struts.action.Action;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionForward;
    import org.apache.struts.action.ActionMapping;

    import com.bms.struts.form.LoginForm;

    /**
    * MyEclipse Struts
    * Creation date: 11-07-2005
    *
    * XDoclet definition:
    * @struts.action path=”/login” name=”loginForm” input=”/form/login.jsp” scope=”request” validate=”true”
    */
    public class LoginAction extends Action {

    // ——————————————————— Instance Variables

    // ——————————————————— Methods

    /**
    * Method execute
    * @param mapping
    * @param form
    * @param request
    * @param response
    * @return ActionForward
    */
    public ActionForward execute(
    ActionMapping mapping,
    ActionForm form,
    HttpServletRequest request,
    HttpServletResponse response) {
    LoginForm loginForm = (LoginForm) form;

    System.out.println(“My new struts”);
    // TODO Auto-generated method stub
    return mapping.findForward(“success”);
    }

    }

    struts-config.xml

    <?xml version=”1.0″ encoding=”UTF-8″?>
    <!DOCTYPE struts-config PUBLIC “-//Apache Software Foundation//DTD Struts Configuration 1.2//EN” “http://struts.apache.org/dtds/struts-config_1_2.dtd”&gt;

    <struts-config>
    <data-sources />
    <form-beans >
    <form-bean name=”loginForm” type=”com.bms.struts.form.LoginForm” />

    </form-beans>

    <global-exceptions />
    <global-forwards />
    <action-mappings >
    <action
    attribute=”loginForm”
    input=”/form/login”
    name=”loginForm”
    path=”/login”
    scope=”request”
    type=”com.bms.struts.action.LoginAction” >
    <forward name=”success” path=”/form/success.jsp” />
    </action>

    </action-mappings>

    <message-resources parameter=”com.bms.struts.ApplicationResources” />
    </struts-config>

    I create a war file . deploy it with weblogic 8.1. I call the login.jsp page and submit it I see “My new struts ” in weblogic console .
    Now i add just System.out.println(“Learn Struts”) to LoginAction.java. I saved the changes Now i deletes the exixting war file and create a new war file . I call the login.jsp page and submit it .I dont the newly added System.out.println(“Learn Struts”) in my weblogic console. I see the class files are updates in web-inf folder .

    please help

    #241160

    Riyad Kalla
    Member

    You will need to tell WebLogic to reload the new WAR file. You can also try shutting down WebLogic, erasing your deployment and creating a NEW deployment of type “exploded”. Then your changes should be deployed real-time.

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Wierd Problem

You must be logged in to post in the forum log in