jsp页面判断是否安装插件
以下为在jsp页面javascript实现方式:
如果需要设置地址供用户下载使用
1. 需要导入jspSmartUpload.jar包。
2. 在页面添加<%@ page import=”com..jspsmart.upload.*”%>
function createOCX()
{
try
{
//创建ActiveXobject对象时传入插件的VersionIndependProgID
//此处判断系统中是否安装meidaPlay插件
var t = new ActiveXObject("WMPlayer.OCX");
alert("this is a player");
}
catch(e)
{
//当出现异常的时候指定用户下载地址下载此插件
<%
out.clear();
response.reset();
SmartUpload su=newSmartUpload();
su.initialize(pageContext);
su.downloadFile("D:/****.rar");
//su.downloadFile中为供用户下载的地址
%>
相关文档:
ActionContext.getContext().getSession().put("login", "1");
<%
String flag=(String)session.getAttribute("login");
if(flag==null)
response.sendRedirect("login.jsp");
%> ......
一、jsp连接Oracle8/8i/9i数据库(用thin模式)
testoracle.jsp如下:
< %@ page contentType= "text/html;charset=gb2312 "% >
< %@ page import= "java.sql.* "% >
< html >
< ......
系统环境:Linux 5.0 AS 64位
步骤:
1、下载apache-tomcat-5.5.23.tar和jdk-1_5_0_12-linux-i586.bin并存放在/usr/local文件夹下;
2、安装jdk
[root@localhost local]#chmod 775 jdk-1_5_0_12-linux-i586.bin '非必须,要是直接运行时提示权限不够时改变权限;
[root@localhost local]#./jd ......
Servlet三个要素:
1.必须继承自HttpServlet
2.必须实现doGet()或者doPost()
3.必须在web.xml中配置Servlet
<servlet>
<servlet-name> </servlet-name>
<servlet-class> </servlet-class>
</servlet>
<servlet-mapping>
<servlet-name> </servlet-nam ......
在Java web开发中常会使用到功能强大的过滤器,他毕竟能给我们带来很大的方便,但是针对过滤的资源我们需要详细的了解他们在web.xml中的配置信息。这个根据几种常用的不同情况进行了总结:
1。如果要映射过滤应用程序中所有资源:
<filter>
<filter-name>loggerfilter</filter-name>
<f ......