jsp或用js获得服务器的IP地址
js好像本身不能获取服务器的IP,但JSP可以,所以用个隐藏域,js就可以借鸡下蛋了。
jsp代码如下:
<input type="hidden" id="serviceIp" name="serviceIp" value="<%=InetAddress.getLocalHost().getHostAddress()%>">
js代码如下:
function getServiceIP(){
var serviceIp = document.getElementById("serviceIp").value;
var href ='http://'+serviceIp+':8080/test/';
}
相关文档:
在jsp中,如果在url中传递中文时会出现乱码,在网上关于这一问题的解决方法五花八门,但都不是很奏效!其实解决方法非常简单: 第一步:编码(以传递的参数为str为例) 在传递数据前将str进行编码Java.net.URLEncoder.encode(str) 第二步:解码 在获取数据端将得到的数据进行解码 new String(str.getBytes("ISO8859_1"))
......
相同点:
如果被包含进去的文件里面有css文件的话,包含的页面会受到被包含文件的css样式的影响!
不同点:
<%@ include
file="date.jsp" %>
<jsp:include
page="date.jsp" flush="true"/>
include
编译指令是在
JSP
程序 ......
在jsp中引用response.setContentType("application/msword");,打开的页面就是word样式。
1、实现word横打:
<style>
@page
{mso-page-border-surround-header:no;
mso-page-border-surround-footer:no;}
@page Section1
{size:841.9pt 595.3pt;//纸张的大小
mso-page-orientation:l ......
这两天在为项目嵌入这个插件,搞得焦头烂额,成功插入了的,可是不知道什么问题,就是上传不了图片,竟然出现了这样的警告:WARN net.fckeditor.handlers.RequestCycleHandler - No property found for UserPathBuilder implementation! The 'DefaultUserFilesPath' will be used in the ConnectorServlet!
在网上找了半 ......