问题标签 [servletconfig]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
servlets - ServletConfig 与 ServletContext
ServletConfig
和ServletContext
接口有什么区别?
java - 集群应用环境中的 ServletContex 属性
我将我的应用程序部署在具有两台服务器的集群中。当我使用以下方式设置任何属性时:
- 是否可以通过两个服务器访问
testObj
带有密钥的属性?test
- 服务器的数量是否等于 JVM 的数量?就我而言,有两台服务器,这是否意味着有两个 JVM?
- 根据我的理解, ServletContext是每个 JVM 每个 webapp 一个,所以在我的情况下,
testObj
当通过两个 JVM 访问时是否可用?
servlets - spring-flex 1.5.2 JUnit 测试错误 servletContext null
我的项目 flex 4 + spring-flex 1.5.2 + spring 3.1 + hibernate 3.6(jpa2.0),可以在浏览器中运行,但不适用于 JUnit4。
JUnit 错误:
我的persistence.xml
我的 applicationContext.xml
我的配置文件有问题吗?
servlets - Servlet url 模式 - servlet 上下文中的 java.lang.NullPointerException
我的 servlet 执行三个任务:
当它收到消息时,“resourceupdate”将请求的资源(HTML 页面)存储到对象 sharedClient。
当它接收到异步获取(由“t = UPDATE”指示的查询字符串)时,将对象 sharedClient 添加到此请求挂起。
当它接收到一个delivery_resource(由pathinfo myServlet/sharedsessionID 表示——例如myServlet/8439jfndofsd93jcanjc)执行资源的调度。
这是我的 Web.xml:
我以这种方式保留所有活动的 SharedClients:
我以这种方式获得具有特定 SharedSessionID 的 SharedClient:
现在的问题是:直到我执行 resourceupdate servlet 工作正常,但是当我执行 delivery_resource(到 myServlet/sharedsessionID 类型的路径)时,servlet 无法获取 sharedClient 引用,并且我得到一个空指针异常。
从这个时候开始,异步获取的长轮询也没有成功完成。
如果我在更新后没有对 myServlet/sharedsessionID 类型的路径执行 delivery_resource,则异步获取继续正常运行。
谢谢大家。
jsp - servletConfig.getInitParameterNames() is not working
I need to show two URLs into a JSP, but I want to pass some init parameters to the JSP page for doing this.
So, this is my web.xml :
In the index.jsp, I wrote the following code:
But when I run the jsp, this show some initParameters that I don't need. By example:
logVerbosityLevel
httpMethods
keepgenerated
p2 ----------- > This is the parameter that I need
xpoweredBy
p1 ----------- > This is other parameter that I need
system-jar-includes
com.sun.appserv.jsp.classpath
My questions is:
Why the JSP file are using all this parameters?
Note: I'm using Glassfish.
java - 使用 getServletConfig 获取文件名时出错
我正在使用JasperReport
Java Web 应用程序中的生成报告。
我有以下行来获取报告文件。
但是当我尝试使用上面的行时,我得到了FileNotFoundException
. 但是当我尝试使用以下行时,程序成功执行。
所以,我想知道第一行有什么问题?
提前致谢...
jsf - 如何在 JSF Managed bean 中访问 ServletConfig
目前,我正在尝试将Confident CAPTCHA集成到我的 JSF 项目中。该类的构造函数ConfidentCaptchaClient
如下:
这需要一个ServletConfig
论据。如何在托管 bean 中获取它?
java - Servlet 上下文不工作
请我尝试将播放器对象存储在 HashTable 中,然后将其存储在 ServletContext 中。当类被调用时,它应该检查播放器(对象)是否已经在存储在 Servlet 上下文中的 playerList(HashTable)中。但是每次我调用该类时,它都会显示 player(object) 不在 playerList (HashTable) 中,因此它会创建一个新的 Player 对象。我试过包括
但它仍然无法正常工作。
在我的 web.xml 我有
编辑:我完整的 web.xml
java - 以编程方式从 web.xml 获取错误页面
我经常有重定向,比如
无论如何,web.xml
已经定义了error-page
s。
如何以编程方式获取配置error.jsp
?
tomcat - 如何更改webapp url
我部署在 tomcat 服务器上的 webapp 的 URL 是:
http://host:port/myapp
对于同一个 tomcat 主页,我如何将此 url 更改为以下内容:
http://test.myapp.com