文件超过4g的文件怎么上传2GQQ和电脑传不了怎么办

5671人阅读
JAVA_WEB(14)
之 动态包含
现在我们来看看JSP 的动态包含指令: &jsp:include /&
我们新建一个工程TestInclude
然后加入文件:
Index.jsp:
&%@ page language=&java&import=&java.util.*& pageEncoding=&ISO-8859-1&%&
&jsp:include page=&curDate.jsp?user=ken&/&
&p&index.jsp'srequest: &%out.println(request);%& &/p&
&%@ page language=&java&import=&java.util.*& %&
&p&curDate.jsp: &%=new Date()%&&/p& &!-- curDate--&
&%= request.getParameter(&user&) %&
&p&curDate.jsp's request: &%out.println(request);%& &/p&
查看结果/源代码:
查看Tomcat 工作目录:
查看index_jsp.java文件:
response.setContentType(&text/charset=ISO-8859-1&);
pageContext =_jspxFactory.getPageContext(this, request,response,
null, true, 8192, true);
_jspx_page_context = pageC
application =pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out =
out.write(&\r\n&);
out.write(&&html&\r\n&);
out.write(& &body&\r\n&);
out.write(&
org.apache.jasper.runtime.JspRuntimeLibrary.include(request,response, &curDate.jsp?user=ken&, out, false);
out.write(&\r\n&);
out.write(& \t&p&index.jsp's request: &);
out.print(request);
out.write(& &/p&\r\n&);
out.write(& &/body&\r\n&);
out.write(&&/html&\r\n&);
} catch (java.lang.Throwable t) {
curDate_jsp.java:
response.setContentType(&text/html&);
pageContext =_jspxFactory.getPageContext(this, request,response,
null, true, 8192, true);
_jspx_page_context = pageC
application =pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out =
out.write(&\r\n&);
out.write(&&p&curDate.jsp: &);
out.print(new Date());
out.write(&&/p& &!-- curDate --&\r\n&);
out.print( request.getParameter(&user&) );
out.write(&\r\n&);
out.write(&&p&curDate.jsp's request: &);
out.print(request);
out.write(& &/p&&);
} catch (java.lang.Throwable t) {
在index_jsp.java文件中
我们看到的&jsp:include page=&curDate.jsp?user=ken&/&实际被编译成以下语句:
org.apache.jasper.runtime.JspRuntimeLibrary.include&curDate.jsp?user=ken&, out, false);
这个是动态地将参数 (request, response, &curDate.jsp?user=ken&,out, false);传递到curDate_jsp. java里执行,注意这些参数在实际程序中是动态的,所以当执行这个语句时,.class 返回结果给index_jsp.class,而这个结果是存放在参数中的对象out中的..简单地说就是
curDate.jsp取得参数并计算出结果后,再将结果返回给index.jsp(在运行时动态调用的)
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:214652次
积分:2415
积分:2415
排名:第13315名
原创:43篇
评论:35条
(1)(1)(1)(2)(1)(1)(4)(5)(3)(6)(14)(5)求助,js 动态页面include_java吧_百度贴吧
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&签到排名:今日本吧第个签到,本吧因你更精彩,明天继续来努力!
本吧签到人数:0成为超级会员,使用一键签到本月漏签0次!成为超级会员,赠送8张补签卡连续签到:天&&累计签到:天超级会员单次开通12个月以上,赠送连续签到卡3张
关注:600,436贴子:
求助,js 动态页面include收藏
是这样的,我在一个页面中有个input表单元素用的onblur事件,然后这个页面被另一个页面动态包涵,然后这个页面的onblur事件就不起作用了,有大神知道吗?
玛纳塔专注于家庭教育、家庭健康的定制服务
准确来说就是被包含页面的所有事件都不起作用
但是单一测的话就起作用
元素id命名重复了吧
登录百度帐号推荐应用
为兴趣而生,贴吧更懂你。或AngularJS: ngInclude and dynamic URLs [用AngularJS:nginclude和动态URL] - 问题-字节技术
AngularJS: ngInclude and dynamic URLs
用AngularJS:nginclude和动态URL
问题 (Question)
I'm using the ngInclude directive to load HTML fragments. Now I'm looking for the best way to pass a dynamic URL. I know I can create the URL with string concatenation:
&ng-include src="'/foo/' + fooId + '/bar/' + barId + '/baz/' + bazId"&&/ng-include&
In my eyes this is a bit ugly.
ngHref and ngSrc for example, accept URLs containing {{}} markup. IMHO this syntax is much cleaner:
&img ng-src="/foo/{{fooId}}/bar/{{barId}}/baz/{{bazId}}"/&
&a ng-href="/foo/{{fooId}}/bar/{{barId}}/baz/{{bazId}}"/&
Is there a better way to pass dynamic URLs to ngInclude?
我用的ngInclude指令加载HTML片段。现在我正在寻找通过一个动态的URL的最好的方法。我知道我可以创建连接字符串的URL:&ng-include src="'/foo/' + fooId + '/bar/' + barId + '/baz/' + bazId"&&/ng-include&在我的眼里这是一个有点丑。ngHref和ngSrc例如,接受URL包含{{}}标记。恕我直言,这个语法是非常干净:&img ng-src="/foo/{{fooId}}/bar/{{barId}}/baz/{{bazId}}"/&&a ng-href="/foo/{{fooId}}/bar/{{barId}}/baz/{{bazId}}"/&有没有更好的方法通过动态URL nginclude?
最佳答案 (Best Answer)
Not sure if this is "better" or not, but you could create a function on your scope to encapsulate this.
app.controller("MyCtrl", function($scope) {
$scope.fooId = "123";
$scope.barId = "abc";
$scope.bazId = "abc";
$scope.templateUrl = function() {
return "/foo/"+ $scope.fooId +"/bar/"+ $scope.barId +"/baz/"+ $scope.bazId;
Then you would use it like so...
&div ng-controller="MyCtrl"&
&ng-include src="templateUrl()"&&/ng-include&
Here's a live example of this type of thing:
不知道这是“好”或没有,但你可以创建一个功能在你的范围将这。app.controller("MyCtrl", function($scope) {
$scope.fooId = "123";
$scope.barId = "abc";
$scope.bazId = "abc";
$scope.templateUrl = function() {
return "/foo/"+ $scope.fooId +"/bar/"+ $scope.barId +"/baz/"+ $scope.bazId;
然后您可以使用它像这样…&div ng-controller="MyCtrl"&
&ng-include src="templateUrl()"&&/ng-include&
这是一个活生生的例子,这种类型的事情:
本文翻译自StackoverFlow,英语好的童鞋可直接参考原文:关于include标签导致js路径找不到的问题
关于使用:include标签及&%@ include标签时要注意的事项
先回忆一下二者的区别(对于此篇文章而言,二者在用法上没有区别)
jsp:include是先编译一下included.jsp文件,然后再包含&&&&&&& 先编译,后包含
@ include是先把文件包含就来,然后统一编译&&&&&&&&&&&&&&&&&& 先包含,后编译
今天下午想把Jquery集成到项目中,发现怎么样都会出问题。原因就是路径问题。
在集成时,我的思路是写一个公共JSP文件,里面包含一些常用的js文件,当然此处我用的就是Jquery插件了。
但写完发现单独测试公共JSP是可以使用的,但包含公共JSP页面的页面却始终不能使用JQuery,开始还以为是加载顺序的问题。
几经测试,终于发现了其中的问题。
由于做的项目文件较多,故文件都不放在一个文件夹下:在公共JSP页面中,有
&%@ page language=&java& import=&java.util.*& pageEncoding=&utf-8&%&
&script type=&text/javascript& src=&js/jquery132min.js&&&/script&
&&& &script type=&text/javascript&&&&&&
&&& $(function(){
&&& alert('hello1');
在调用它的时候,有:
&%@ include file=&../../common_ext.jsp&%&
但这样很可能导致错误。
原因是,include之后,公共JSP被加载到自己的JSP,则JQueryr的相对位置已经发生了变化。即公共JSP把JQuery的相对位置传给了自己的JSP,但自己的JSP以自身为标准,通过路径就找不到Jquery插件了。简单地说,就是如果用相对路径,则公共JSP中的路径就应该是相对自己jSP的路径了。
但这样显然失去了它是公共JSP的意义,因此在这里用绝对路径来做:
&%@ page language=&java& import=&java.util.*& pageEncoding=&utf-8&%&
String tPath = request.getContextPath();
String tBasePath = request.getScheme()+&://&+request.getServerName()+&:&+request.getServerPort()+tPath+&/&;
&script type=&text/javascript& src=&&%=tBasePath%&js/jquery132min.js&&&/script&
&&& &script type=&text/javascript&&
&&& $(function(){
&&& alert('hello1');
&&& &/script&
这样,只要在自己的jSP页面中引入公共JSP就可以了。

我要回帖

更多关于 超过4g的文件怎么传输 的文章

 

随机推荐