`

was6.1修改java编译版本

阅读更多
jsp中如果用到了jdk1.5的新特性,在was6.1下编译会出错,所以应用程序部署Was完成之后需要设置相应的JSP引擎配置参数,具体如下:
“jdkSourceLevel” 是在 WasV6.1 中引入的支持 JDK 5 新特性的 JSP 引擎参数。此参数的缺省值为 13。以下是 “jdkSourceLevel”的可选 参数值:
       13(缺省值) - 此值将禁用 JDK 1.4 和 JDK 5.0 的所有新的语言功能部件。
       14 - 此值将启用断言工具并将禁用 JDK 5.0 的所有新的语言功能部件。
       15 - 此值将启用断言工具和 JDK 5.0 的所有新的语言功能部件。

此参数需要在部署完成后通过编辑已部署应用程序的WEB-INF/ibm-web-ext.xmi ,该文件在应用部署后共存放于两个位置:
    1.IBM\WebSphere\AppServer\profiles\AppSrv01\config\cells\节点名称\nodes\节点名称\applications\应用名\deployments
    2./IBM61/WebSphere/AppServer/profiles/AppSrv01/installedApps/localhostCell01\应用名

文件设置,添加如下代码:
<jspAttributes xmi:id="JSPAttribute_0" name="jdkSourceLevel" value="15"/>

修改后的文件为:

<?xml version="1.0" encoding="UTF-8"?>
<webappext:WebAppExtension xmi:version="2.0" xmlns:xmi=http://www.omg.org/XMI
   xmlns:webappext="webappext.xmi" xmlns:webapplication="webapplication.xmi" xmi:id="WebAppExtension_1" 
    reloadInterval="9" reloadingEnabled="true" defaultErrorPage="error.jsp" additionalClassPath=""
    fileServingEnabled="true" directoryBrowsingEnabled="false" serveServletsByClassnameEnabled="true"
    autoRequestEncoding="true" autoResponseEncoding="false"
   <webApp href="WEB-INF/web.xml#WebApp_1"/>
   <jspAttributes xmi:id="JSPAttribute_0" name="jdkSourceLevel" value="15"/>
   <jspAttributes xmi:id="JSPAttribute_1" name="useThreadTagPool" value="true"/>
   <jspAttributes xmi:id="JSPAttribute_2" name="verbose" value="false"/>
   <jspAttributes xmi:id="JSPAttribute_3" name="deprecation" value="false"/>
   <jspAttributes xmi:id="JSPAttribute_4" name="reloadEnabled" value="true"/>
   <jspAttributes xmi:id="JSPAttribute_5" name="reloadInterval" value="5"/>
   <jspAttributes xmi:id="JSPAttribute_6" name="keepgenerated" value="true"/>
   <!--<jspAttributes xmi:id="JSPAttribute_7" name="trackDependencies" value="true"/> -->
   
</webappext:WebAppExtension>


#acegi配置
1)启动websphere管理控制台
2)进:服务器--应用服务器--选您使用的应用服务器(默认是server1)--web容器设置--web容器--定制属性
3)新建一个属性: *名称:com.ibm.ws.webcontainer.invokefilterscompatibility  *值:true  描述:兼容Acegi过滤器
4)保存重启服务器

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics