JiveJdon Community Forums
在线132人 J道首页 | 论坛首页 | 培训咨询 | 开源框架 | 精华 | 查搜 | 注册 | 登陆 |
首页 » 论坛 » 设计模式、框架和架构
???en_US.forumThreadPrev.name??? 上一主题
Go back to the topic listing   返回主题列表
???en_US.forumThreadNext.name??? 下一主题
这个主题共有 1 回复 / 1 页 [ ]  发表新帖子  回复该主题贴
oqc

发表文章: 3
注册时间: 2005年03月10日 13:39
Tomcat开发Struts遇到的问题,请指点 发表: 2005年03月10日 13:41 回复
使用JB9中的Tomcat4.0开发的一个Struts小程序,遇到了问题,不知道问题在哪里。
我的目录结构是:
WEB-INF
---web.xml
---struts-config.xml
---class
---wiley
---LookupAction.class
---LookForm.class
---tld
---struts-html.tld
jsp
---index.jsp
---quote.jsp
images
---hp_logo_wiley.gif
其中,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="lookupForm" type="wiley.LookupForm"/>
</form-beans>
<action-mappings>
<action path="/Lookup" type="wiley.LookupAction" name="lookupForm" input="/jsp/index.jsp">
<forward name="success" path="/jsp/quote.jsp"/>
<forward name="failure" path="/jsp/index.jsp"/>
</action>
</action-mappings>
</struts-config>

web.xml文件的格式为:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<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>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<taglib>
<taglib-uri>/WEB-INF/tld/struts-html.tld</taglib-uri>
<taglib-location>/WEB-INF/tld/struts-html.tld</taglib-location>
</taglib>
</web-app>

并且,index.jsp的内容是:
<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/tld/struts-html.tld" prefix="html" %>
<html>
<head>
<title>Wiley Struts Application</title>
</head>
<body>
<table width="500"
border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
<tr bgcolor="#36566E">
<td height="68" width="48%">
<div align="left">
<img src="images/hp_logo_wiley.gif"
width="220"
height="74">
</div>
</td>
</tr>
<tr>
<td> </td>
</tr>
</table>
<html:form action="/Lookup"
name="lookupForm"
type="wiley.LookupForm" >
<table width="45%" border="0">
<tr>
<td>Symbol:</td>
<td><html:text property="symbol" /></td>
</tr>
<tr>
<td colspan="2" align="center"><html:submit /></td>
</tr>
</table>
</html:form>
</body>
</html>

在IE中输入后,问题好像除在index.jsp中的标签库html上,出现了异常。还有各疑问就是关于相对路径的问题:
web.xml中,<param-value>>/WEB-INF/struts-config.xml</param-value>中,使用了/是不是因为基于ContextPath的。
但是如果在index.jsp中使用hp_logo_wiley.gif文件的话,就需要使用images/hp_logo_wiley.gif呀?
我的这个程序该怎么改,才是对的?谢谢大家了
oqc

发表文章: 3
注册时间: 2005年03月10日 13:39
Re: Tomcat开发Struts遇到的问题,请指点 发表: 2005年03月10日 13:44 回复
oqcf31541511h.doc
怎么一贴就成这样了。只好通过上传来说我的问题了。
这个主题有 1 回复 / 1 页 [ ]
???en_US.forumThreadPrev.name??? 上一主题
Go back to the topic listing   返回主题列表    返回页首  返回页首
???en_US.forumThreadNext.name??? 下一主题
热点TAG: AOP cache DDD EJB 集群 设计模式 Hibernate IOC JiveJdon OO RBAC Spring Struts
查询本论坛内 回复超过的热门帖子
快速发表回复
标题
 
粗体 斜体 下划线 插入图片 插入代码 插入url链接 插入附件
内容
 

解惑之道在J道 ,打造中国最具影响力的的企业软件社区
OpenSource JIVEJDON v3.0 Powered by JdonFramework Code © 2002-07 jdon.com

anti spam