代码如下
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ page import="java.util.Locale" %>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>
<%
String language = request.getParameter("lan");
%>
<%
Locale locale = null;

if(language.equals("cn")){
locale = Locale.SIMPLIFIED_CHINESE;
}if(language.equals("en")){
locale = Locale.US;
}
session.setAttribute(org.apache.struts.Globals.LOCALE_KEY, locale);
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html:html lang="true">
  <head>
    <html:base />
    
    <title>main.jsp</title> <meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">    
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->  </head>
  
  <body>
    <bean:message key="form.languagefamily" />
  </body>
</html:html>
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
在tomcat上什么问题也没有,到了websphere上提示如下错误:
—————————————————————————————————————
错误消息:JSPG0047E: 找不到 URI http://struts.apache.org/tags-html 的标记库
根本原因:com.ibm.ws.jsp.JspCoreException: JSPG0047E: 找不到 URI http://struts.apache.org/tags-html 的标记库 at com.ibm.ws.jsp.translator.visitor.tagfiledep.TagFileDependencyVisitor.visitCustomTagStart(TagFileDependencyVisitor.java:74) at com.ibm.ws.jsp.translator.visitor.JspVisitor.processJspElement(JspVisitor.java:267) at com.ibm.ws.jsp.translator.visitor.JspVisitor.processChildren(JspVisitor.java:309) at com.ibm.ws.jsp.translator.visitor.JspVisitor.processJspElement(JspVisitor.java:139) at com.ibm.ws.jsp.translator.visitor.JspVisitor.visit(JspVisitor.java:121) at com.ibm.ws.jsp.translator.JspTranslator.processVisitors(JspTranslator.java:121) at com.ibm.ws.jsp.translator.utils.JspTranslatorUtil.translateJsp(JspTranslatorUtil.java:181) at com.ibm.ws.jsp.translator.utils.JspTranslatorUtil.translateJspAndCompile(JspTranslatorUtil.java:83) at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionServletWrapper.translateJsp(AbstractJSPExtensionServletWrapper.java:349) at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionServletWrapper._checkForTranslation(AbstractJSPExtensionServletWrapper.java:317) at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionServletWrapper.checkForTranslation(AbstractJSPExtensionServletWrapper.java:226) at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionServletWrapper.handleRequest(AbstractJSPExtensionServletWrapper.java:131) at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionProcessor.handleRequest(AbstractJSPExtensionProcessor.java:270) at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3107) at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:238) at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:811) at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1425) at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:92) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:465) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:394) at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:102) at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:152) at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:213) at com.ibm.io.async.AbstractAsyncFuture.fireCompletionActions(AbstractAsyncFuture.java:195) at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136) at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:193) at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:725) at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:847) at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1498)
—————————————————————————————————————
本人对websphere不是很了解,特请教大家,谢谢!

解决方案 »

  1.   

    web.xml里这样配置标签库,而且标签库都放在WEB-INF目录下
    ————————————————————————————————————
    <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>
    ————————————————————————————————
      

  2.   

    <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
    <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
    <%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
    <%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>
    <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>
    ---------------------------------
    你自己说, 能对应上吗?
    uri要一样, 随便写成什么都行, 如下:<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
    <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
    <%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
    <%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>
    <taglib>
        <taglib-uri>http://struts.apache.org/tags-bean</taglib-uri>
        <taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
      </taglib>
      <taglib>
        <taglib-uri>http://struts.apache.org/tags-html</taglib-uri>
        <taglib-location>/WEB-INF/struts-html.tld</taglib-location>
      </taglib>
      

  3.   

    还真是这样,看来websphere的确比tomcat“要求”的严格。