我想request.getContextPath()
在扩展的JSP标记内部调用SimpleTagSupport
,有什么方法可以做到吗?
是否有任何scala JSP引擎,或者会有什么?我知道scala web框架提升,但它似乎更像标签.我正在寻找像PHP这样的脚本的方法.
谢谢.
我想用来JavaCompiler
动态创建一些类.
我找到了javax.tools
包的源代码,但是没有实现; 互联网上的一些帖子说它依赖于tools.jar
,我不确定是否tools.jar
与JRE有关.
那么,我可以在没有安装JDK的JRE环境中运行程序吗?
另一个问题,即实现细节JavaCompiler
是什么,是创建一个新的进程来调用javac
命令?
谢谢
我正在使用GWT-2.0.3和eclipse插件构建一个GWT项目.好吧,首先我试过,JSTL1.2和servlet 2.5,
在web.xml中,我使用:
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
id="WebApp_ID" version="2.5">
Run Code Online (Sandbox Code Playgroud)在jsp页面中,我使用:
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<c:forEach var="app" items="${requestScope.apps}">
<tr><td width=20%><c:out value="${app.mapping}"></c:out></td>
<td width=40%><c:out value="${app.description}"></c:out></td>
...
Run Code Online (Sandbox Code Playgroud)如果我删除foreach标签,它可以正常工作.但如果我使用核心标签,我会得到以下异常:
HTTP ERROR: 500
javax.servlet.jsp.PageContext.getELContext()Ljavax/el/ELContext;
RequestURI=/system/view/register.html
Caused by:
java.lang.AbstractMethodError: javax.servlet.jsp.PageContext.getELContext()Ljavax/el/ELContext;
at javax.servlet.jsp.jstl.core.LoopTagSupport.unExposeVariables(LoopTagSupport.java:587)
at javax.servlet.jsp.jstl.core.LoopTagSupport.doFinally(LoopTagSupport.java:323)
at org.apache.jsp.system.view_jsp._jspx_meth_c_forEach_0(view_jsp.java:267)
at org.apache.jsp.system.view_jsp._jspx_meth_a_body_0(view_jsp.java:186)
at org.apache.jsp.system.view_jsp._jspService(view_jsp.java:98)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:729)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:285)
at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:126)
at org.app4j.test.DispatchServlet.doGet(DispatchServlet.java:133)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at …
Run Code Online (Sandbox Code Playgroud)