Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Servlet/JSP/JSF/JavaFX Script  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
reply to postflat modethreaded modego to previous topicgo to next topicgo to back
作者 关于struts的几个问题请教
nykey





发贴: 5
于 2005-01-31 12:27 user profilesend a private message to userreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
我的主要工具:tomcat+eclipse
第一个:struts标签如何写,我写了一个,但是页面显示出来的空白,程序如下:
<%@page contentType="text/html;charset=GB2312"language="java"%>
<%@taglib uri="/WEB-INF/struts-bean.tld"prefix="bean"%>
<%@taglib uri="/WEB-INF/struts-html.tld"prefix="htem"%>
<%@taglib uri="/WEB-INF/struts-logic.tld"prefix="logic"%>
<%@taglib uri="/WEB-INF/struts-template.tld"prefix="template"%>
<html:html>
<head><title>simple struts!</title></head>
<body bgColor=white>
<html:base/><html:form method="post" action="/HelloWorldAction.do">
<html:text property="mybeanvariabled"/><html:submit value="enter"/>
<html:reset value="reset"/>
</html:form>
</body>
</html:html>
第二个:actionservlet如何启动呢?
web.xml是这样定义的
<?xml version="1.0"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_3.dtd">

<web-app>
<!-- Action Servlet Configuration -->
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
  <init-param>
    <param-name>debug</param-name>
    <param-value>2</param-value>
  </init-param>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>

<!-- Action Servlet Mapping -->
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>

<!-- The Welcome File List -->
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>

<!-- Struts Tag Library Descriptors -->
<taglib>
<taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
</taglib>

<taglib>
<taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-html.tld</taglib-location>
</taglib>

<taglib>
<taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
</taglib>
<taglib>
  <taglib-uri>/WEB-INF/struts-template.tld</taglib-uri>
  <taglib-location>/WEB-INF/struts-template.tld</taglib-location>
</taglib>
</web-app>
struts-config.xml的配置如下:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.0//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd">
<struts-config>
<form-beans>
<form-bean name="HelloWordForm"type="HelloWordForm" />
</form-beans>
<action-mappings>
<action path="/HelloWordAction"
type="HelloWordAction"
name="HelloWordForm"
scope="session"
input="/HelloWord.jsp">
<forward name="success" path="/out.jsp" />
<forward name="failure" path="error.jsp"/>
</action>
</action-mappings>
</struts-config>
问题如下:tomcat启动过程中一切正常,但是一旦要进入一旦传送HelloWorldAction.do系统提示错误:servlet is not avariable!
请问这到底是什么原因造成的呢?我都是按照网上的实例来配置的,为什么还会出现这样的问题呢?




为什么这个Applet不能在浏览器显示啊?

话题树型展开
人气 标题 作者 字数 发贴时间
1877 关于struts的几个问题请教 nykey 3035 2005-01-31 12:27
1459 Re:关于struts的几个问题请教 mutu 135 2005-02-02 14:25

reply to postflat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923