新手,对jsp和struts都不熟,没办法,硬着头皮上的

解决方案 »

  1.   

    有加<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>这些吗??
      

  2.   

    这是源文件
    <%@ page contentType="text/html;charset=UTF-8" language="java" %>
    <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
    <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%><html:html lang="true"> 
    <head>
    <title><bean:message key="hello.jsp.title"/></title>
    <html:base/>
    </head> <body bgcolor="red"><p>
    <h2><bean:message key="hello.jsp.heading"/></h2><p>
    <html:errors/><p> <logic:present name="personbean" scope="request">
    <h2>
    <bean:message key="hello.jsp.hello"/>
    <bean:write name="personbean" property="userName"/>!<p>
    </h2>
    </logic:present> <html:form action="/HelloWorld.do" focus="userName">
    <bean:message key="hello.jsp.prompt.peson"/>
    <html:text property="uerName" size="16" maxlength="16"/><br>
    <html:submit property="submit" value="Submit"/>
    <html:reset/>
    </html:form><br>

    <html:img page="/struts-power.gif" alt="Powered by Struts"/>
    </body>
    </html:html>
      

  3.   

    tld文件存放对吗?web.xml里面有加吗??
      

  4.   

    这是web.xml  <taglib>
        <taglib-uri>/tags/struts-bean</taglib-uri>
        <taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
      </taglib>
      <taglib>
        <taglib-uri>/tags/struts-html</taglib-uri>
        <taglib-location>/WEB-INF/struts-html.tld</taglib-location>
      </taglib>
      <taglib>
        <taglib-uri>/tags/struts-logic</taglib-uri>
        <taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
      </taglib>
      <taglib>
        <taglib-uri>/tags/struts-nested</taglib-uri>
        <taglib-location>/WEB-INF/struts-nested.tld</taglib-location>
      </taglib>
      <!-- tiles not used here
        <taglib>
          <taglib-uri>/tags/struts-tiles</taglib-uri>
          <taglib-location>/WEB-INF/struts-tiles.tld</taglib-location>
        </taglib>
      

  5.   

    <%@ taglib uri="/tags/struts-bean.tld" prefix="bean" %>
    <%@ taglib uri="/tags/struts-html.tld" prefix="html"%>
    <%@ taglib uri="/tags/struts-logic.tld" prefix="logic"%>改成这样试试
      

  6.   

    <%@ taglib uri="/tags/struts-bean" prefix="bean" %>
    <%@ taglib uri="/tags/struts-html" prefix="html"%>
    <%@ taglib uri="/tags/struts-logic" prefix="logic"%>
      

  7.   

    回 crazer2003():就是说那些标签本来应该被解释成html代码的,而我打开页面以后什么也没显示。就显示了hello.jsp里有的一个“!”。查看网页源代码,可以看到hello.jsp的源代码。我用的是tomcat服务器,开发环境:eclipse
      

  8.   

    回zeq258(近朱者赤) :还没开始做项目呢,正在打基础的阶段
      

  9.   

    先写一个简单的jsp页面测试看看能不能正确执行。比如:1+1=<%=1+1%>
      

  10.   

    搞明白了,是eclipse的tomcat插件问题,忘了设置context declartion mode,应该是context files那项
      

  11.   

    那我再IntelliJ idea下怎么办? 那不是更惨?~~~直接出来一个404找不到页面,我try了确定是标签的问题,我的配置和他一样,应该没有问题,*.tld放在WEB-INF目录下。怎么办?~