??xml version="1.0" encoding="utf-8" standalone="yes"?>手机在线一区二区三区,亚洲欧洲中文字幕,亚洲精品一区久久久久久http://www.aygfsteel.com/youngturk/category/19358.htmlThe world is a fine place , and worth fighting for it.zh-cnMon, 18 Feb 2013 02:42:00 GMTMon, 18 Feb 2013 02:42:00 GMT60javascrip与页面执行顺?/title><link>http://www.aygfsteel.com/youngturk/archive/2013/02/06/395181.html</link><dc:creator>youngturk</dc:creator><author>youngturk</author><pubDate>Wed, 06 Feb 2013 07:57:00 GMT</pubDate><guid>http://www.aygfsteel.com/youngturk/archive/2013/02/06/395181.html</guid><wfw:comment>http://www.aygfsteel.com/youngturk/comments/395181.html</wfw:comment><comments>http://www.aygfsteel.com/youngturk/archive/2013/02/06/395181.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/youngturk/comments/commentRss/395181.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/youngturk/services/trackbacks/395181.html</trackback:ping><description><![CDATA[2、gq脚?<br />HTML4.0?lt;script>标签定义了defer的属性。这个属性的用途是表明脚本在执行时不会(x)影响面的构造。也是_脚本?x)gq到整个面都解析完毕后在执行。因此,?lt;script>元素中设|defer属性(如下面的例子Q,实际上与上面介绍的把<script>元素攑֜面底部的效果是一L(fng)?<br /><html> <br /><head> <br />  <title> New Document </title> <br />  <script type="text/javascript" defer="defer" src="example1.js"></script> <br />  <script type="text/javascript" defer="defer" src="example2.js"></script> <br /></head> <br /><body> <br />  <!--q里攑ֆ?-> <br /></body> <br /></html> <br />q个例子中,虽然我们?lt;script>元素攑֜了文档的<head>元素中,但其中包含的脚本gq到览器遇?lt;/html>标签后在执行?<br />不过Q问题是q所有浏览器都支持defer属性,IE和firefox3.0是目前唯一支持defer属性的L览器。其他浏览器则会(x)忽略q个属性,不gq脚本的执行 <img src ="http://www.aygfsteel.com/youngturk/aggbug/395181.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/youngturk/" target="_blank">youngturk</a> 2013-02-06 15:57 <a href="http://www.aygfsteel.com/youngturk/archive/2013/02/06/395181.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>从request获取各种路径ȝ request.getRealPath("url"); // 虚拟目录映射为实际目?request.getRealPat http://www.aygfsteel.com/youngturk/archive/2013/01/23/394584.htmlyoungturkyoungturkWed, 23 Jan 2013 01:01:00 GMThttp://www.aygfsteel.com/youngturk/archive/2013/01/23/394584.htmlhttp://www.aygfsteel.com/youngturk/comments/394584.htmlhttp://www.aygfsteel.com/youngturk/archive/2013/01/23/394584.html#Feedback0http://www.aygfsteel.com/youngturk/comments/commentRss/394584.htmlhttp://www.aygfsteel.com/youngturk/services/trackbacks/394584.html
从request获取各种路径ȝ 
request.getRealPath(
"url"); // 虚拟目录映射为实际目?nbsp;


request.getRealPath(
"./");    // |页所在的目录 

request.getRealPath(
"../"); // |页所在目录的上一层目?nbsp;

request.getContextPath();    
// 应用的web目录的名U?nbsp;


如http:
//localhost:7001/bookStore/ 
/bookStore/ => [contextPath] (request.getContextPath()) 

获取Web目的全路径 
String strDirPath 
= request.getSession().getServletContext().getRealPath("/"); 

以工E名为TESTZQ?nbsp;

(
1)得到包含工程名的当前面全\径:(x)request.getRequestURI() 
l果Q?/span>/TEST/test.jsp 


(
2)得到工程名:(x)request.getContextPath() 
l果Q?/span>/TEST 


(
3)得到当前面所在目录下全名Uͼ(x)request.getServletPath() 
l果Q如果页面在jsp目录?nbsp;
/TEST/jsp/test.jsp 


(
4)得到面所在服务器的全路径Qapplication.getRealPath("面.jsp"
l果QD:\resin\webapps\TEST\test.jsp 


(
5)得到面所在服务器的绝对\径:(x)absPath=new java.io.File(application.getRealPath(request.getRequestURI())).getParent(); 
l果QD:\resin\webapps\TEST 

2.在类中取得\径:(x) 

(
1)cȝl对路径QClass.class.getClass().getResource("/").getPath() 
l果Q?/span>/D:/TEST/WebRoot/WEB-INF/classes/pack/ 


(
2)得到工程的\径:(x)System.getProperty("user.dir"
l果QD:\TEST 

3.在Servlet中取得\径:(x) 

(
1)得到工程目录Qrequest.getSession().getServletContext().getRealPath("") 参数可具体到包名?nbsp;
l果QE:\Tomcat\webapps\TEST 


(
2)得到IE地址栏地址Qrequest.getRequestURL() 
l果Qhttp:
//localhost:8080/TEST/test 


(
3)得到相对地址Qrequest.getRequestURI() 
l果Q?/span>/TEST/test 


youngturk 2013-01-23 09:01 发表评论
]]>
用JSP实现上传文g的两U方?http://www.aygfsteel.com/youngturk/archive/2013/01/22/394570.htmlyoungturkyoungturkTue, 22 Jan 2013 09:27:00 GMThttp://www.aygfsteel.com/youngturk/archive/2013/01/22/394570.htmlhttp://www.aygfsteel.com/youngturk/comments/394570.htmlhttp://www.aygfsteel.com/youngturk/archive/2013/01/22/394570.html#Feedback0http://www.aygfsteel.com/youngturk/comments/commentRss/394570.htmlhttp://www.aygfsteel.com/youngturk/services/trackbacks/394570.html阅读全文

youngturk 2013-01-22 17:27 发表评论
]]>
Struts2文g上传功能开?http://www.aygfsteel.com/youngturk/archive/2012/11/29/392239.htmlyoungturkyoungturkThu, 29 Nov 2012 15:47:00 GMThttp://www.aygfsteel.com/youngturk/archive/2012/11/29/392239.htmlhttp://www.aygfsteel.com/youngturk/comments/392239.htmlhttp://www.aygfsteel.com/youngturk/archive/2012/11/29/392239.html#Feedback0http://www.aygfsteel.com/youngturk/comments/commentRss/392239.htmlhttp://www.aygfsteel.com/youngturk/services/trackbacks/392239.html技术要?
本节代码详细说明文g上传功能的开发流E,介绍知识点如下:(x)
1. 文g上传面和显CZ传成功页面代码内宏V?
2. UploadActioncM实现上传功能Ҏ(gu)和上传文件属性介l?
3. struts.xml中UploadAction配置Q以及字W编码、文件(f)时存放\径配|?
4. 上传后所处\径和最l上传成功后效果展示?
<!---------------------文g名:(x)upload.jsp----------------->
<%@taglib prefix="s" uri="/struts-tags"%>
<html>
    
<head>
        
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
        
<title>上传文g</title>
    
</head>
    
<body>
    
<!-- 上传文g表单定义 -->
    
<s:form action="upload" method="post" enctype="multipart/form-data">
        
<tr>
    
<!-- 上传文g标签定义 -->
    
<td>上传文g:<s:file name="file"></s:file></td>
    
</tr>
    
<tr>
    
<td>再次上传文g:<s:file name="file"></s:file></td>
    
</tr>
    
<tr>
    
<td align="left"><s:submit name="submit" value="提交"></s:submit></td>
    
</tr>
    
</s:form>
    
</body>
</html>
 
<!-------------------上传文g成功后结果页面文件名Qresult.jsp ----------------->
<%@taglib prefix="s" uri="/struts-tags"%>
<html>
    
<head>
        
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
        
<title>上传l果</title>
    
</head>
    
<body>
        上传文gQ?br />        
<!-- 昄上传成功文g?nbsp;-->
        
<s:property value="fileFileName" />
    
</body>
</html>
<!------------------文g名:(x)UploadAction.java ------------------>
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.List;

import org.apache.struts2.ServletActionContext;
import com.opensymphony.xwork2.ActionSupport;

//文g上传Action
public class UploadAction extends ActionSupport {
    
//上传文g存放路径
    private final static String UPLOADDIR = "/upload";
    
//上传文g集合
    private List<File> file;
    
//上传文g名集?/span>
    private List<String> fileFileName;
    
//上传文g内容cd集合
    private List<String> fileContentType;

    
public List<File> getFile() {
        
return file;
    }


    
public void setFile(List<File> file) {
        
this.file = file;
    }


    
public List<String> getFileFileName() {
        
return fileFileName;
    }


    
public void setFileFileName(List<String> fileFileName) {
        
this.fileFileName = fileFileName;
    }


    
public List<String> getFileContentType() {
        
return fileContentType;
    }


    
public void setFileContentType(List<String> fileContentType) {
        
this.fileContentType = fileContentType;
    }


    
public String execute() throws Exception {
        
for (int i = 0; i < file.size(); i++{
            
//循环上传每个文g
            uploadFile(i);
        }

        
return "success";
    }


    
//执行上传功能
    private void uploadFile(int i) throws FileNotFoundException, IOException {
        
try {
            InputStream in 
= new FileInputStream(file.get(i));
            String dir 
= ServletActionContext.getRequest().getRealPath(UPLOADDIR);
            File uploadFile 
= new File(dir, this.getFileFileName().get(i));
            OutputStream out 
= new FileOutputStream(uploadFile);
            
byte[] buffer = new byte[1024 * 1024];
            
int length;
            
while ((length = in.read(buffer)) > 0{
                out.write(buffer, 
0, length);
            }


            in.close();
            out.close();
        }
 catch (FileNotFoundException ex) {
            ex.printStackTrace();
        }
 catch (IOException ex) {
            ex.printStackTrace();
        }

    }

}
struts.xml配置文g中有x件上传的配置Q?br /><!--------------------文g名:(x)struts.xml------------------->
<struts>
 <!-- pȝ帔R定义Q定义上传文件字W集~码 -->
 <constant name="struts.i18n.encoding" value="gb2312"></constant>
 <!-- pȝ帔R定义Q定义上传文件(f)时存放\?-->
 <constant name="struts.multipart.saveDir" value="c:\"></constant>
 <!-- Action所在包定义 -->
 <package name="C04.4" extends="struts-default">
  <!-- Action名字Q类以及D面定义 -->
  <!-- 通过Actioncd理才D的的Action定义 -->
  <action name="upload" class="action.UploadAction">
   <result name="input">/jsp/upload.jsp</result>
   <result name="success">/jsp/result.jsp</result>
  </action>
 </package>
</struts>


youngturk 2012-11-29 23:47 发表评论
]]>
js循环滚动新闻Q最z版 http://www.aygfsteel.com/youngturk/archive/2012/11/27/392066.htmlyoungturkyoungturkTue, 27 Nov 2012 05:48:00 GMThttp://www.aygfsteel.com/youngturk/archive/2012/11/27/392066.htmlhttp://www.aygfsteel.com/youngturk/comments/392066.htmlhttp://www.aygfsteel.com/youngturk/archive/2012/11/27/392066.html#Feedback0http://www.aygfsteel.com/youngturk/comments/commentRss/392066.htmlhttp://www.aygfsteel.com/youngturk/services/trackbacks/392066.html
<script type="text/javascript">    
//滚动信息
window.onload=function(){marquee('roll_box','roll_content','roll_temp','40'); }
function marquee(id,id1,id2,speed)
{    
    var obj
=document.getElementById(id);
    var obj1
=document.getElementById(id1);
    var obj2
=document.getElementById(id2);
    obj2.innerHTML
=obj1.innerHTML;
    function scrolly()
{if(obj.scrollTop>=obj1.offsetHeight){obj.scrollTop=0;}else{obj.scrollTop++;}}
//function scrolly(){if(obj.scrollTop>=obj1.offsetHeight){obj1.offsetHeight-=obj.scrollTop;}else{obj.scrollTop++;}}

    var rollTime
=setInterval(scrolly,speed);
    obj.onmouseover
=function(){clearInterval(rollTime);}
    obj.onmouseout
=function(){rollTime=setInterval(scrolly,speed);}
}
 
</script>


<div id="roll_box" style="height:200px;overflow:hidden;"><div id="roll_content">
    
    
<!--滚动内容start-->
    
<li><a href="/index.php/news/show/id/10782" target="_blank">格?#174;孕妇lD3钙片成功获得国食?img src="http://www.aygfsteel.com/Images/dot.gif" alt="" /></a><span></span></li>
    
<li><a href="/index.php/news/show/id/10781" target="_blank">我公司喜h北省著名商标</a><span></span></li>
    
<li><a href="/index.php/news/show/id/10780" target="_blank">喜讯Q我公司已被评ؓ(f)“2010q度?img src="http://www.aygfsteel.com/Images/dot.gif" alt="" /></a><span></span></li>
    
<li><a href="/index.php/news/show/id/10779" target="_blank">我公司参加华人华创创业发展洽谈会(x)展会(x)</a></li>
    
<li><a href="/index.php/news/show/id/10775" target="_blank">出生~陷诊断防治q展高培训班在郑州</a></li>
    
<li><a href="/index.php/news/show/id/10774" target="_blank">敬告各位朋友Q福格森免费400882</a></li>
    
<li><a href="/index.php/news/show/id/10743" target="_blank">“格?#8221;爱心奉献滕州市病D儿家庭</a></li>
    
<li><a href="/index.php/news/show/id/10742" target="_blank">格热烈祝贺湖北省计划生育服务交流</a></li>
    
<li><a href="/index.php/news/show/id/10740" target="_blank">预防出生~陷 全社?x)的责Q-----</a></li>
    
<li><a href="/index.php/news/show/id/10737" target="_blank">南日报Q历城筑牢三道防U拦截出生缺</a></li>  
    
<!--滚动内容end-->                      
    
</div><div id="roll_temp"></div>
</div>


youngturk 2012-11-27 13:48 发表评论
]]>
FCKEditor2.6.3配合Java的用步?(后台文本~辑?http://www.aygfsteel.com/youngturk/archive/2012/11/13/391261.htmlyoungturkyoungturkTue, 13 Nov 2012 08:36:00 GMThttp://www.aygfsteel.com/youngturk/archive/2012/11/13/391261.htmlhttp://www.aygfsteel.com/youngturk/comments/391261.htmlhttp://www.aygfsteel.com/youngturk/archive/2012/11/13/391261.html#Feedback0http://www.aygfsteel.com/youngturk/comments/commentRss/391261.htmlhttp://www.aygfsteel.com/youngturk/services/trackbacks/391261.htmlFCKEditor是一个很好的用于Web面中的格式化文本编译控件。现在越来越多的论坛的发帖页面中更多的用了q个控gQ我们这里将如何在基于Java的web开发中使用FCKEditor控g的步骤提供给大家Qؓ(f)的是让更多的java开发者花Ҏ(gu)的旉d重复力_?

首先M载FCKEditor2.6.3Q当然本文编写的时候,q个是最新版本,也许你现在看到的已经是更新的版本了,那么可能某些配置办法已经变化了,本文也将跟进以保持最新动态,相反如果你用的旧版本的控gQ其配置和用方法也有所区别Q,下蝲地址Qhttp://www.fckeditor.net/downloadQ我们需要下载两个文?br /> 
W一是FCKeditor_2.6.3.zipQ就是FCKEditor的控Ӟ

W二是FCKeditor.JavaQfckeditor-java-2.4.1-bin.zipQ,是在Java代码中用FCKEditor的相兛_L(fng)Q?

有了q两个文Ӟ使用FCKEditor的基具备了Q接下来我们要做两g事情Q一件事情就是要把FCKEditor控g攑ֈweb目中,q个控g是用于网늚Q所以其代码是用JavaScript脚本~写的,需要和web|页一赯下蝲的浏览器上才能执行,W二件事情就是这个网上的控件因为支持图片的上传与下载,所以在上传与下载的时候需要服务端的支持,那么我们我的java服务端如何支持这个控件的工作呢?FCKEditor自n提供了相关的java工具Q就是我们下载的W二个文件。因此我们要做的W二件事情就是在服务端配|java工具Q得FCKEditor控g在处理上传图片时能够正确工作?

接下来我们就开始对配置FCKEditor控gq行两项工作Q?

W一Q解压羃FCKeditor_2.6.3.zipQ在其中我们能找C个文件夹叫fckeditorQ那么将q个文gҎ(gu)个复制到你的web应用的根目录下,是存放jsp面的地斏V?

W二Q解压羃fckeditor-java-2.4.1-bin.zipQ将q样几个jar文g复制到web应用的WEB-INF\lib目录中(commons-fileupload-1.2.1.jarQcommons-io-1.3.2.jarQjava-core-2.4.1.jarQslf4j-api-1.5.2.jarQslf4j-simple-1.5.2.jarQ,其中最后一个文件在q个zip包中可能不存在,那么你可以去q个链接地址下蝲一个文件叫fckeditor-java-2.4.1-bin.zip (下蝲地址Qhttp://sourceforge.net/project/showfiles.php?group_id=75348&package_id=129511)Q在q个war文g中的lib中存在上q的5个jar文gQ其实在war中也包含了FCKEditor控g的内容,也就是说如果你只是下载了war也可以了。然后在classpath目录中创Z个名叫ؓ(f)fckeditor.properties的文Ӟ文g中放|一行内容ؓ(f)Qconnector.userActionImpl=net.fckeditor.requestcycle.impl.UserActionImplQ?

在web.xml中添加一个Servlet的配|,配置内容如下Q?

<servlet>
<servlet>
<servlet-name>Connector</servlet-name>
<servlet-class>net.fckeditor.connector.ConnectorServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
<servlet-name>Connector</servlet-name>
<url-pattern>/fckeditor/editor/filemanager/connectors/*</url-pattern>
</servlet-mapping>

好了Q现在你已经完成了配|的q程Q接下来我们需要在jsp中用FCKEditor控g了,在需要用这个控件的jsp文g的开头添加标{ֺ的引入语句:(x)<%@ taglib uri="http://java.fckeditor.net" prefix="FCK" %>Q在使用控gq行文本格式化输入的地方Q原来你可能使用的textarea标签Q用如下的内容来替换原来的输入控gQ?

<FCK:editor instanceName="EditorDefault">

控g中要昄的初始内?

</FCK:editor>

其中instanceName属性的值就相当于form表单中的input的name倹{就是表单提交时候的键值对中的键的名字?



youngturk 2012-11-13 16:36 发表评论
]]>
EL表达式不起作用原?/title><link>http://www.aygfsteel.com/youngturk/archive/2012/11/13/391246.html</link><dc:creator>youngturk</dc:creator><author>youngturk</author><pubDate>Tue, 13 Nov 2012 03:04:00 GMT</pubDate><guid>http://www.aygfsteel.com/youngturk/archive/2012/11/13/391246.html</guid><wfw:comment>http://www.aygfsteel.com/youngturk/comments/391246.html</wfw:comment><comments>http://www.aygfsteel.com/youngturk/archive/2012/11/13/391246.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/youngturk/comments/commentRss/391246.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/youngturk/services/trackbacks/391246.html</trackback:ping><description><![CDATA[web.xml?.4版本的默认导入的standerd.jar,和jstl.jar是用el表达式的包是启动?br />?.5版本的web.xml中默认是关闭?br />所以在2.5的所有jsp中需要启动一?br />?lt;% page isELIgnored="false"%><br /><br /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; display: inline !important; font: 14px/26px Arial; white-space: normal; orphans: 2; float: none; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">el表达式不起作?/span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; font: 14px/26px Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; font: 14px/26px Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; font: 14px/26px Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; display: inline !important; font: 14px/26px Arial; white-space: normal; orphans: 2; float: none; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">        今天用el表达式,老是得不到后Cq来的倹{该导入的jar包和标签库也都导入了。还是不起作用。后来在|上扑ֈ一文章。解决了。原来是版本的问题。现在脓(chung)一下?/span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; font: 14px/26px Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; font: 14px/26px Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; font: 14px/26px Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; display: inline !important; font: 14px/26px Arial; white-space: normal; orphans: 2; float: none; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">tomcat5.0的版? 使用了低版本Q只求稳定?/span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; font: 14px/26px Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; font: 14px/26px Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; font: 14px/26px Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; display: inline !important; font: 14px/26px Arial; white-space: normal; orphans: 2; float: none; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">web.xml</span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; font: 14px/26px Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; font: 14px/26px Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; font: 14px/26px Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; display: inline !important; font: 14px/26px Arial; white-space: normal; orphans: 2; float: none; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><?xml version="1.0" encoding="ISO-8859-1"?></span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; font: 14px/26px Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; font: 14px/26px Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; font: 14px/26px Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; display: inline !important; font: 14px/26px Arial; white-space: normal; orphans: 2; float: none; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><web-app xmlns="http://java.sun.com/xml/ns/j2ee"</span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; font: 14px/26px Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; font: 14px/26px Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; font: 14px/26px Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; display: inline !important; font: 14px/26px Arial; white-space: normal; orphans: 2; float: none; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"</span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; font: 14px/26px Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; font: 14px/26px Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; font: 14px/26px Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; display: inline !important; font: 14px/26px Arial; white-space: normal; orphans: 2; float: none; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"</span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; font: 14px/26px Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; font: 14px/26px Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; font: 14px/26px Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; display: inline !important; font: 14px/26px Arial; white-space: normal; orphans: 2; float: none; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">    version="2.4"></span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; font: 14px/26px Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; font: 14px/26px Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; font: 14px/26px Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; display: inline !important; font: 14px/26px Arial; white-space: normal; orphans: 2; float: none; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">2.4版本默认启用el表达式,如果使用2.5版本Q默认el表达式是关闭?/span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; font: 14px/26px Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; font: 14px/26px Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; font: 14px/26px Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; display: inline !important; font: 14px/26px Arial; white-space: normal; orphans: 2; float: none; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><?xml version="1.0" encoding="UTF-8"?></span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; font: 14px/26px Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; font: 14px/26px Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; font: 14px/26px Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; display: inline !important; font: 14px/26px Arial; white-space: normal; orphans: 2; float: none; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><web-app xmlns="http://java.sun.com/xml/ns/javaee" </span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; font: 14px/26px Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; font: 14px/26px Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; font: 14px/26px Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; display: inline !important; font: 14px/26px Arial; white-space: normal; orphans: 2; float: none; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.5" </span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; font: 14px/26px Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; font: 14px/26px Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; font: 14px/26px Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; display: inline !important; font: 14px/26px Arial; white-space: normal; orphans: 2; float: none; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee   </span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; font: 14px/26px Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; font: 14px/26px Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; font: 14px/26px Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; display: inline !important; font: 14px/26px Arial; white-space: normal; orphans: 2; float: none; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">    http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"></span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; font: 14px/26px Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; font: 14px/26px Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; font: 14px/26px Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; display: inline !important; font: 14px/26px Arial; white-space: normal; orphans: 2; float: none; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">那么对应2.5的web.xml -->  jsp面里应该增?lt;%@ page isELIgnored="false"%></span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; font: 14px/26px Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; font: 14px/26px Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; font: 14px/26px Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; display: inline !important; font: 14px/26px Arial; white-space: normal; orphans: 2; float: none; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">一句话Q凡是部|描q文仉循Servlet2.4规范的WEB应用QEL表达式的计算默认是启用的Q而未遵@的,则EL表达式的计算默认是禁用的?/span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; font: 14px/26px Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; font: 14px/26px Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; font: 14px/26px Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; display: inline !important; font: 14px/26px Arial; white-space: normal; orphans: 2; float: none; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">所以解x案还可以是:(x)web.xml中的DTD(文档cd定义)攚w2.4的版?/span><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; font: 14px/26px Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; font: 14px/26px Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><br style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; font: 14px/26px Arial; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /><span style="text-align: left; widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; display: inline !important; font: 14px/26px Arial; white-space: normal; orphans: 2; float: none; letter-spacing: normal; color: rgb(51,51,51); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">我用的是在公共页中加?lt;%@ page isELIgnored="false"%>Q然后每个页面引入公共页。问题解决了?/span><img src ="http://www.aygfsteel.com/youngturk/aggbug/391246.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/youngturk/" target="_blank">youngturk</a> 2012-11-13 11:04 <a href="http://www.aygfsteel.com/youngturk/archive/2012/11/13/391246.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>关于EL表达式中requestScope和param区别 http://www.aygfsteel.com/youngturk/archive/2012/11/12/391205.htmlyoungturkyoungturkMon, 12 Nov 2012 07:30:00 GMThttp://www.aygfsteel.com/youngturk/archive/2012/11/12/391205.htmlhttp://www.aygfsteel.com/youngturk/comments/391205.htmlhttp://www.aygfsteel.com/youngturk/archive/2012/11/12/391205.html#Feedback0http://www.aygfsteel.com/youngturk/comments/commentRss/391205.htmlhttp://www.aygfsteel.com/youngturk/services/trackbacks/391205.html

今天演示EL表达式的时候发现自己jsp的基实在是薄弱,在这个很单的问题上迷惑了很久?/p>

首先在看遇到的问题:(x)

在浏览器地址输入Q表CZ入一个参数testQgؓ(f)123

http://localhost:8888/Test/index.jsp?test=123


在index.jsp中尝试用EL表达式取出,代码如下Q?/p>

 <body>
${test}
</body>

发现毫无l果Q再使用requestScope试取出Q?/p>

  <body>
${requestScope.test}
</body>

发现q是毫无l果Q感到非常诧异,遂干脆用java脚本试取出?/p>

  <body>
<%request.getAttribute("test"); %>
</body>


依然无解?/p>

之后发现Q若使用已下代码向request作用域赋|则用上面代码可以取出

<%
request.setAttribute(
"test", "123");
%>

 


查询资料后发玎ͼ使用以下代码可以取出之前的请求参敎ͼ(x)
EL:

  <body>
${param.test}
</body>

JAVA脚本Q?/p>

  <body>
<%=request.getParameter("test") %>
</body>

l论是Q?span style="widows: 2; text-transform: none; text-indent: 0px; border-collapse: separate; font: medium Simsun; white-space: normal; orphans: 2; letter-spacing: normal; color: #ff0000; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none" class="Apple-style-span">${param.name} {h(hun)?request.getParamter("name")Q这两种Ҏ(gu)一般用于服务器从页面或者客L(fng)获取的内宏V?/span>

     ${requestScope.name} {h(hun)?nbsp;request.getAttribute("name")Q一般是从服务器传递结果到面Q在面中取出服务器保存的倹{?/span>

 

参考资料:(x)

el表达式中?{param}

http://topic.csdn.net/u/20090103/15/779af9b8-c3a7-4f3e-82fe-b08bf2630996.html



youngturk 2012-11-12 15:30 发表评论
]]>
关于EL表达式中requestScope和param区别 http://www.aygfsteel.com/youngturk/archive/2012/11/12/391206.htmlyoungturkyoungturkMon, 12 Nov 2012 07:30:00 GMThttp://www.aygfsteel.com/youngturk/archive/2012/11/12/391206.htmlhttp://www.aygfsteel.com/youngturk/comments/391206.htmlhttp://www.aygfsteel.com/youngturk/archive/2012/11/12/391206.html#Feedback0http://www.aygfsteel.com/youngturk/comments/commentRss/391206.htmlhttp://www.aygfsteel.com/youngturk/services/trackbacks/391206.html

今天演示EL表达式的时候发现自己jsp的基实在是薄弱,在这个很单的问题上迷惑了很久?/p>

首先在看遇到的问题:(x)

在浏览器地址输入Q表CZ入一个参数testQgؓ(f)123

http://localhost:8888/Test/index.jsp?test=123


在index.jsp中尝试用EL表达式取出,代码如下Q?/p>

 <body>
${test}
</body>

发现毫无l果Q再使用requestScope试取出Q?/p>

  <body>
${requestScope.test}
</body>

发现q是毫无l果Q感到非常诧异,遂干脆用java脚本试取出?/p>

  <body>
<%request.getAttribute("test"); %>
</body>


依然无解?/p>

之后发现Q若使用已下代码向request作用域赋|则用上面代码可以取出

<%
request.setAttribute(
"test", "123");
%>

 


查询资料后发玎ͼ使用以下代码可以取出之前的请求参敎ͼ(x)
EL:

  <body>
${param.test}
</body>

JAVA脚本Q?/p>

  <body>
<%=request.getParameter("test") %>
</body>

l论是Q?span style="widows: 2; text-transform: none; text-indent: 0px; border-collapse: separate; font: medium Simsun; white-space: normal; orphans: 2; letter-spacing: normal; color: #ff0000; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none" class="Apple-style-span">${param.name} {h(hun)?request.getParamter("name")Q这两种Ҏ(gu)一般用于服务器从页面或者客L(fng)获取的内宏V?/span>

     ${requestScope.name} {h(hun)?nbsp;request.getAttribute("name")Q一般是从服务器传递结果到面Q在面中取出服务器保存的倹{?/span>

 

参考资料:(x)

el表达式中?{param}

http://topic.csdn.net/u/20090103/15/779af9b8-c3a7-4f3e-82fe-b08bf2630996.html



youngturk 2012-11-12 15:30 发表评论
]]>
q转码问题http://www.aygfsteel.com/youngturk/archive/2012/10/11/389386.htmlyoungturkyoungturkThu, 11 Oct 2012 06:53:00 GMThttp://www.aygfsteel.com/youngturk/archive/2012/10/11/389386.htmlhttp://www.aygfsteel.com/youngturk/comments/389386.htmlhttp://www.aygfsteel.com/youngturk/archive/2012/10/11/389386.html#Feedback0http://www.aygfsteel.com/youngturk/comments/commentRss/389386.htmlhttp://www.aygfsteel.com/youngturk/services/trackbacks/389386.htmlconvert(username, "ISO8850-1","GBK")
convert(username, 
"ISO8850-1","ISO8850-1")
public static String convert(String src, String decoding, String encoding) {
        
if(src == null || decoding == null || encoding == null)
            
return null;

        
if(decoding.equals(encoding))
            
return src;

        String rs 
= null;
        
try {
            
byte[] tb = src.getBytes(decoding);
            rs 
= new String(tb, 0, tb.length, encoding);
        }
 catch (UnsupportedEncodingException e) {
            rs 
= src;
        }


        
return rs;
或?String username 
=new String(request.getParameter("username").getBytes("iso8859-1"),"gbk");


youngturk 2012-10-11 14:53 发表评论
]]>
报getOutputStream() has already been called for this response q个错误http://www.aygfsteel.com/youngturk/archive/2012/09/24/388450.htmlyoungturkyoungturkMon, 24 Sep 2012 09:33:00 GMThttp://www.aygfsteel.com/youngturk/archive/2012/09/24/388450.htmlhttp://www.aygfsteel.com/youngturk/comments/388450.htmlhttp://www.aygfsteel.com/youngturk/archive/2012/09/24/388450.html#Feedback0http://www.aygfsteel.com/youngturk/comments/commentRss/388450.htmlhttp://www.aygfsteel.com/youngturk/services/trackbacks/388450.html    下面两点是我自己ȝ出来的:(x)
    1、在我们应用验证码时Q都?x)用到字节流response.getOutputStream()来将验证码输出,但是jsp面自己最后会(x)调用字符JspWriter的out()Ҏ(gu)页面的内容输出。通过查看servlet的API我们可以看到知道Q在servlet中不能够同时利用q两个流输出Q解军_法将验证码写在servlet中,具体见下面?br />    2、相信请求{? request.getRequestDispacher().forward() )和请求蟩? response.sendRedirect() )的区别大安知道。其中request.getRequestDispacher().forward() Ҏ(gu)的调用者与被调用者之间共享相同的request对象和response对象Q它们属于同一个访问请求和响应q程。JSP面转译为的_servlet?x)最后调用releasePageContext()Ҏ(gu)( All PageContext objects obtained via this method shall be released by invoking releasePageContext().)释放我们面所有的实体对象Q当我们的调用者有面输出Ӟ׃(x)抛出q个异常。具体原因也没有弄清楚,各位大侠如果谁知道可以告知一下。其实验证码也是同一个原理,如果我们验证码的代码写在jsp面中,因ؓ(f)jsp面?x)调用JspWriter的out()Ҏ(gu)内容输出,同时我们的图片又调用了response.getOutputStream()Ҏ(gu)因此?x)抛个异常;如果我们验证码写在servlet中,׃?x)同时用两U输Z׃?x)出错。有时即使调用者页面没有输出,也会(x)抛出q个异常Q仔l看jsp转译以后的源码发现输Z换行Q因此,我们最好把调用者页面的%>?lt;%之间换行LQ把%>?lt;%直接写在一赗?br />    另外Q如果我们实在要在jsp中用到response.getOutputStream()Q比如验证码、jspSmartUploadQ我们需要在最后加入如下代码:(x)
        response.reset();
        out.clear();
        out=pageContext.pushBody();



youngturk 2012-09-24 17:33 发表评论
]]>
当session长时间不d失效问题,再重d出现两个嵌套d面http://www.aygfsteel.com/youngturk/archive/2012/08/02/384586.htmlyoungturkyoungturkThu, 02 Aug 2012 03:11:00 GMThttp://www.aygfsteel.com/youngturk/archive/2012/08/02/384586.htmlhttp://www.aygfsteel.com/youngturk/comments/384586.htmlhttp://www.aygfsteel.com/youngturk/archive/2012/08/02/384586.html#Feedback0http://www.aygfsteel.com/youngturk/comments/commentRss/384586.htmlhttp://www.aygfsteel.com/youngturk/services/trackbacks/384586.html<script   language="javascript">  
      if (top != window)  
      top.location.href = window.location.href;  
  </script> 



youngturk 2012-08-02 11:11 发表评论
]]>
html格式http://www.aygfsteel.com/youngturk/archive/2007/07/24/131968.htmlyoungturkyoungturkTue, 24 Jul 2007 01:34:00 GMThttp://www.aygfsteel.com/youngturk/archive/2007/07/24/131968.htmlhttp://www.aygfsteel.com/youngturk/comments/131968.htmlhttp://www.aygfsteel.com/youngturk/archive/2007/07/24/131968.html#Feedback0http://www.aygfsteel.com/youngturk/comments/commentRss/131968.htmlhttp://www.aygfsteel.com/youngturk/services/trackbacks/131968.htmlcolspan合ƈ?/span>JSP语法<jsp:useBean>http://www.aygfsteel.com/youngturk/archive/2007/01/26/96205.htmlyoungturkyoungturkFri, 26 Jan 2007 09:42:00 GMThttp://www.aygfsteel.com/youngturk/archive/2007/01/26/96205.htmlhttp://www.aygfsteel.com/youngturk/comments/96205.htmlhttp://www.aygfsteel.com/youngturk/archive/2007/01/26/96205.html#Feedback0http://www.aygfsteel.com/youngturk/comments/commentRss/96205.htmlhttp://www.aygfsteel.com/youngturk/services/trackbacks/96205.html JSP语法 关于jsp?lt;jsp:usebean>http://www.aygfsteel.com/youngturk/archive/2007/01/26/96204.htmlyoungturkyoungturkFri, 26 Jan 2007 09:40:00 GMThttp://www.aygfsteel.com/youngturk/archive/2007/01/26/96204.htmlhttp://www.aygfsteel.com/youngturk/comments/96204.htmlhttp://www.aygfsteel.com/youngturk/archive/2007/01/26/96204.html#Feedback1http://www.aygfsteel.com/youngturk/comments/commentRss/96204.htmlhttp://www.aygfsteel.com/youngturk/services/trackbacks/96204.html jsp:usebean 的详l用?/span> JSP摘录http://www.aygfsteel.com/youngturk/archive/2007/01/26/96183.htmlyoungturkyoungturkFri, 26 Jan 2007 08:54:00 GMThttp://www.aygfsteel.com/youngturk/archive/2007/01/26/96183.htmlhttp://www.aygfsteel.com/youngturk/comments/96183.htmlhttp://www.aygfsteel.com/youngturk/archive/2007/01/26/96183.html#Feedback0http://www.aygfsteel.com/youngturk/comments/commentRss/96183.htmlhttp://www.aygfsteel.com/youngturk/services/trackbacks/96183.html HTTP-EQUIVcM于HTTP的头部协?它回应给览器一些有用的信息,以帮助正和_地显C网内宏V常用的HTTP-EQUIVcd? 1、Content-Type和Content-Language (昄字符集的讑֮)
http-equiv="Page-Exit"的意思是指页面离开时生效果?它有一U写?? http-equiv="Page-Enter"则是指页面进入时产生的效果?br />
session的传?/span>


youngturk 2007-01-26 16:54 发表评论
]]>
jsp初识http://www.aygfsteel.com/youngturk/archive/2007/01/26/96163.htmlyoungturkyoungturkFri, 26 Jan 2007 07:15:00 GMThttp://www.aygfsteel.com/youngturk/archive/2007/01/26/96163.htmlhttp://www.aygfsteel.com/youngturk/comments/96163.htmlhttp://www.aygfsteel.com/youngturk/archive/2007/01/26/96163.html#Feedback0http://www.aygfsteel.com/youngturk/comments/commentRss/96163.htmlhttp://www.aygfsteel.com/youngturk/services/trackbacks/96163.html 

初始
JavaBean 的JSP
下拉?/span>


youngturk 2007-01-26 15:15 发表评论
]]>
面间链接和数据传递的三种方式http://www.aygfsteel.com/youngturk/archive/2007/01/19/94965.htmlyoungturkyoungturkFri, 19 Jan 2007 09:13:00 GMThttp://www.aygfsteel.com/youngturk/archive/2007/01/19/94965.htmlhttp://www.aygfsteel.com/youngturk/comments/94965.htmlhttp://www.aygfsteel.com/youngturk/archive/2007/01/19/94965.html#Feedback0http://www.aygfsteel.com/youngturk/comments/commentRss/94965.htmlhttp://www.aygfsteel.com/youngturk/services/trackbacks/94965.html 01 .html  < html ...  阅读全文

youngturk 2007-01-19 17:13 发表评论
]]>
表单的验?/title><link>http://www.aygfsteel.com/youngturk/archive/2007/01/19/94951.html</link><dc:creator>youngturk</dc:creator><author>youngturk</author><pubDate>Fri, 19 Jan 2007 08:11:00 GMT</pubDate><guid>http://www.aygfsteel.com/youngturk/archive/2007/01/19/94951.html</guid><wfw:comment>http://www.aygfsteel.com/youngturk/comments/94951.html</wfw:comment><comments>http://www.aygfsteel.com/youngturk/archive/2007/01/19/94951.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/youngturk/comments/commentRss/94951.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/youngturk/services/trackbacks/94951.html</trackback:ping><description><![CDATA[     摘要: 客户端的验证 Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->        表单的客L(fng)验证主要是通过JavaScript来完成的? < htm...  <a href='http://www.aygfsteel.com/youngturk/archive/2007/01/19/94951.html'>阅读全文</a><img src ="http://www.aygfsteel.com/youngturk/aggbug/94951.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/youngturk/" target="_blank">youngturk</a> 2007-01-19 16:11 <a href="http://www.aygfsteel.com/youngturk/archive/2007/01/19/94951.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>关于Enumerationhttp://www.aygfsteel.com/youngturk/archive/2007/01/19/94942.htmlyoungturkyoungturkFri, 19 Jan 2007 07:28:00 GMThttp://www.aygfsteel.com/youngturk/archive/2007/01/19/94942.htmlhttp://www.aygfsteel.com/youngturk/comments/94942.htmlhttp://www.aygfsteel.com/youngturk/archive/2007/01/19/94942.html#Feedback0http://www.aygfsteel.com/youngturk/comments/commentRss/94942.htmlhttp://www.aygfsteel.com/youngturk/services/trackbacks/94942.html <%

   //得到所有的参数名称,一个实?Enumeration 接口的对象生成一pd元素Q每ơ生成一个?/span>

   java.util.Enumeration e=request.getParameterNames();

   // Ҏ(gu)有参数进行@?/span>

   while(e.hasMoreElements()) 
 
   {

      // 得到参数?/span>

      String name=(String)e.nextElement();

      // 得到q个参数的所有?/span>

      String[] value=request.getParameterValues(name);

      // 输出参数?/span>

      out.print("<p>");

       out.print("<h3>"+name+":");

      // 对一个参数所有的D行@?/span>

      for(inti=0;i<value.length;i++)

      {

         // 输出一个参数?/span>

         out.print(value[i]);

         if(i!=value.length-1)

         out.print(",");

      }

      out.print("</h3></p>");

   }

%>

分析


youngturk 2007-01-19 15:28 发表评论
]]>
վ֩ģ壺 Ѯ| ͸| | | ɽ| | ɽ| | | ػʵ| ̫| ٹ| | | Ƕ| | | ͬ| | ˫| | ˫Ѽɽ| | ɳƺ| | | ȳ| ɽ| ڽ| | ٹ| ˳ƽ| ʡ| ¤| Ϫ| | Ѩ| Ĵʡ| κ| | |