facebook

[Closed] 2 warnings in Struts Quickstart Guide

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

    killazy
    Member

    i use eclipse 3.2 and myeclipse 5.0
    when i read the <<struts development demo>>,and then do step by step follow the demo,there are two warnings:
    1.The local variable userLoginForm is never read
    2.The serializable class UserLoginForm does not declare a static final serialVersionUID field of type long
    help!
    as a beginner,i really don’t why.because others do follow the demo,they success,but i can’t.
    [maybe u dont understand what i mean,but i hope u can help me.][/img]

    #260579 Reply

    Riyad Kalla
    Member

    These are just compiler warnings, not errors. There is nothing wrong with the code, the warnings are only hinting potential areas for you to address.

    #260609 Reply

    killazy
    Member

    thanks.
    i know,but i found my tomcat can’t use suddenly.
    why?yesterday it is ok.

    #260610 Reply

    Riyad Kalla
    Member

    It’s hard to say from the description. What exactly is happening? Is it not starting? Not stopping? Are you getting a 404 or some other error? Is the app server showing any errors on startup?

    #260614 Reply

    killazy
    Member

    the problem is solved,because the port 80 is used by other application.
    but i create Form,Action and JSP follow the guide,but struts-config.xml design view isnot display in the design window.
    in addition,after deploy in tomcat ,the application runs successfully.
    i want to know why there is undisplay?thanks

    #260622 Reply

    Riyad Kalla
    Member

    Be sure you have the design view selected at the bottom of the editor, there should be two small tabs, they are easy to miss.

    #260683 Reply

    killazy
    Member

    i’m sure i select the design tab.
    so i am so puzzled.

    #260695 Reply

    Riyad Kalla
    Member

    Very strange, so you ran the wizard, created the new artifacts and you see them in the source view, but you don’t see them in the design view, is that correct?

    #260726 Reply

    killazy
    Member

    yes

    #260733 Reply

    Riyad Kalla
    Member

    Can you try saving the file, switching to the navigator view, erasing the .mex file if one exists, then reopening the file in thee designer?

    #260734 Reply

    killazy
    Member

    sorry
    tell me how to switching to the navigator view,i can’t find the .mex file?

    #260735 Reply

    killazy
    Member

    i find the .mex file.i delete it ,and then reopen the filein the designer.
    the system says:”unable to locate struts model entension file . struts-config.mex a new file will be created to retain graphical layout date between modeling sessions”,then i click ok.but the design view is blank also.

    #260742 Reply

    Riyad Kalla
    Member

    Can you paste the contents of your struts-config.xml file for me?

    #260780 Reply

    killazy
    Member

    <?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=”userLoginForm” type=”com.yourcompany.struts.form.UserLoginForm” />

    </form-beans>

    <global-exceptions />
    <global-forwards />
    <action-mappings >
    <action
    attribute=”userLoginForm”
    input=”/userLogin.jsp”
    name=”userLoginForm”
    path=”/userLogin”
    scope=”request”
    type=”com.yourcompany.struts.action.UserLoginAction”
    validate=”false”>
    <forward name=”success” path=”/userLoginSuccess.jsp” />
    <forward name=”failure” path=”/userLogin.jsp” />
    </action>

    </action-mappings>

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

    #260781 Reply

    killazy
    Member

    web.xml
    <?xml version=”1.0″ encoding=”UTF-8″?>
    <web-app xmlns=”http://java.sun.com/xml/ns/j2ee&#8221; xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance&#8221; version=”2.4″ xsi:schemaLocation=”http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd”&gt;
    <servlet>
    <servlet-name>action</servlet-name>
    <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
    <init-param>
    <param-name>config</param-name>
    <param-value>/WEB-INF/struts-config.xml</param-value>
    </init-param>
    <init-param>
    <param-name>debug</param-name>
    <param-value>3</param-value>
    </init-param>
    <init-param>
    <param-name>detail</param-name>
    <param-value>3</param-value>
    </init-param>
    <load-on-startup>0</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>action</servlet-name>
    <url-pattern>*.do</url-pattern>
    </servlet-mapping>
    </web-app>

Viewing 15 posts - 1 through 15 (of 18 total)
Reply To: [Closed] 2 warnings in Struts Quickstart Guide

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