- This topic has 17 replies, 2 voices, and was last updated 18 years, 7 months ago by
Riyad Kalla.
-
AuthorPosts
-
killazyMemberi 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]
Riyad KallaMemberThese are just compiler warnings, not errors. There is nothing wrong with the code, the warnings are only hinting potential areas for you to address.
killazyMemberthanks.
i know,but i found my tomcat can’t use suddenly.
why?yesterday it is ok.
Riyad KallaMemberIt’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?
killazyMemberthe 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
Riyad KallaMemberBe sure you have the design view selected at the bottom of the editor, there should be two small tabs, they are easy to miss.
killazyMemberi’m sure i select the design tab.
so i am so puzzled.
Riyad KallaMemberVery 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?
killazyMemberyes
Riyad KallaMemberCan you try saving the file, switching to the navigator view, erasing the .mex file if one exists, then reopening the file in thee designer?
killazyMembersorry
tell me how to switching to the navigator view,i can’t find the .mex file?
killazyMemberi 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.
Riyad KallaMemberCan you paste the contents of your struts-config.xml file for me?
killazyMember<?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”><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>
killazyMemberweb.xml
<?xml version=”1.0″ encoding=”UTF-8″?>
<web-app xmlns=”http://java.sun.com/xml/ns/j2ee” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” version=”2.4″ xsi:schemaLocation=”http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd”>
<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> -
AuthorPosts