解决方案 »
- 请问如何才能不输入工程名称?
- 一个远程数据管理问题
- 一个简单的js,很急,在线等。
- 谁有richfaces tree 组件的例子,跪谢!
- 关于单例模式
- jsf部署weblogic出错,这里有认识weblogic的人吗?
- 从网页读取的JSON数据,在andriod显示时出现问题。
- 刚学EJB,HelloEjb出错。。。
- struts:Cannot find ActionMappings or ActionFormBeans collection
- 能说说XML的好处吗?
- 有没有人看过o`reilly的《Enterprise JavaBeans(第四版)》?
- 为什么Tomcat默认的index.jsp老是阴魂不散?
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.yourcompany.struts.form.HelloForm;
import all.PersonBean;import db.PeopleDB;以及后面所有的ActionMapping下面都有红色的波浪线,而且无法运行呢?
是不是eclipse哪里配置错了?
hello.jsp,result.jsp,struts-config.xml,web.xml3 从http://jakarta.apache.org/下载struts的文件,解压缩。4 右击工程hello,properties-->java build path-->add external jars-->把3中的jar添加进去这时的现象就是helloform.java的package com.yourcompany.struts.form;出错,但我在com.yourcompany.struts.form里的确有helloform.java运行时报错:launch configuration new_configuration(1) references non-existing project a1.(我以前建过工程a1,但已经删除)请大家帮我看看,是否落了什么文件,或者哪里错了
谢谢
http://www.myeclipseide.com/ContentExpress-display-ceid-10.html
还有,我发了两个动画教程到你的邮箱里,我给你的那个程序就是在它的基础上改进的,删除了一个没多大用的类,再建了一个处理数据库连接的类。
以前我一直用JBuiler,不过现在大家越来越注重版权了,所以想改到Eclipse下,那个动画就是看别人是怎么使用Eclipse的开发struts的
就是package com.co; 我的路径都没错错误是:the type of javax.servlet.http.HttpServletRequest can not be resolved.it is indirectly referenced from required class files代码如下:
package com.co;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.yourcompany.struts.form.HelloForm;
import all.PersonBean;import com.db.PeopleDB;
/**
* MyEclipse Struts
* Creation date: 05-26-2005
*
* XDoclet definition:
* @struts:action path="/hello" name="helloForm" input="/form/hello.jsp" scope="request" validate="true"
*/
public class HelloAction 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) {
HelloForm helloForm = (HelloForm) form;
//取出表单中提交的用户名
String userName=helloForm.getUserName();
//根据用户名查'num',这部分工作交由PeopleDB类去做
PeopleDB pDB=new PeopleDB();
int num=pDB.getNum(userName);
//System.out.println("userName: "+userName+" num: "+num);
PersonBean pb=new PersonBean();
pb.setUserName(userName);
pb.setNum(num);
//设置request对象,以便下一个网页从中取数据
request.setAttribute("personbean",pb);
//Hello定向为要提交的页面,struts-config.xml中配置
return mapping.findForward("Hello");
}}
不会吧,我的程序里怎么是package com.yourcompany.struts.form;啊???
sub code: uAR7ZL-835-56-54678656396403716temp
gAR7ZL-819-56-54678656708361578subscriber: 123
code: 6AR7ZL-819-56-5467865794719363
creater你有联系方法吗?给我email一个吧