java web中怎么判断当前服务是用的weblogic还是tomcat?
1.页面验证码:
response.reset();
JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(response.getOutputStream());
//out.clear();
//out=pageContext.pushBody();
tomcat中需要 out.clear();out=pageContext.pushBody();这两行才不报错!
而weblogic 中需要 //out.clear();//out=pageContext.pushBody();才不报错!
2.tomcat中对于前台页面传递中文参数url需要在后台 name=new String(name.getBytes("ISO-8859-1"), "gbk");转换编码格式才能正常接收中文参数。 而对于weblogic则不用这样转码,如果转码了反而出错了。
因为前台代码为 ‘ <tr height="20" align="center" class="mytr" style="cursor:hand" onclick="sysaction22('<%=basePath%>argiSetAction!getSelArea.action?quId=<s:property value="#area.id.countyId"/>&&areaId=<s:property value="#area.id.localId"/>&&name=<s:property value="#area.localName"/>')"> ’ 参数的传递用了 <s: 标签,所以没法对参数进行转码,只能在后台转码,但是后台又要区分是weblogic和tomcat!
请问怎么通过代码区别他们?