tagged [servlets]
Spring get current ApplicationContext
Spring get current ApplicationContext I am using Spring MVC for my web application. My beans are written in "`spring-servlet.xml`" file Now I have a class `MyClass` and i want to access this class usi...
- Modified
- 17 Feb at 11:14
Can I exclude some concrete urls from <url-pattern> inside <filter-mapping>?
Can I exclude some concrete urls from inside ? I want some concrete filter to be applied for all urls except for one concrete (i.e. for `/*` except for `/specialpath`). Is there a possibility to do th...
- Modified
- 6 Sep at 15:16
How do I call a specific Java method on a click/submit event of a specific button in JSP?
How do I call a specific Java method on a click/submit event of a specific button in JSP? My Java file is: In my JSP page I have three HTML buttons. If I click on `button1`, then only `method
Is there a max size for POST parameter content?
Is there a max size for POST parameter content? I'm troubleshooting a Java app where XML is sent between two systems using HTTP POST and Servlet. I suspect that the problem is that the XML is growing ...
How to get host name with port from a http or https request
How to get host name with port from a http or https request I have two applications deployed in a JBoss container (same unix box). If I receive a request from app1, I need to send a corresponding requ...
- Modified
- 17 Aug at 09:20
Creating a mock HttpServletRequest out of a url string?
Creating a mock HttpServletRequest out of a url string? I have a service that does some work on an HttpServletRequest object, specifically using the request.getParameterMap and request.getParameter to...
Adding an HTTP Header to the request in a servlet filter
Adding an HTTP Header to the request in a servlet filter I'm integrating with an existing servlet that pulls some properties out of the HTTP header. Basically, I'm implementing an interface that doesn...
- Modified
- 11 May at 14:58
Get JSF managed bean by name in any Servlet related class
Get JSF managed bean by name in any Servlet related class I'm trying to write a custom servlet (for AJAX/JSON) in which I would like to reference my `@ManagedBeans` by name. I'm hoping to map: `http:/...
- Modified
- 1 Feb at 15:26
Get request URL in JSP which is forwarded by Servlet
Get request URL in JSP which is forwarded by Servlet How can I get request URL in JSP which is forwarded by Servlet? If I run following code in JSP, then I get the server side path to the JSP. Bu
What's the difference between getRequestURI and getPathInfo methods in HttpServletRequest?
What's the difference between getRequestURI and getPathInfo methods in HttpServletRequest? I'm making a simple, very lightweight front-controller. I need to match request paths to different handlers (...
How to solve javax.net.ssl.SSLHandshakeException Error?
How to solve javax.net.ssl.SSLHandshakeException Error? I connected with VPN to setup the inventory API to get product list and it works fine. Once I get the result from the web-service and i bind to ...
- Modified
- 12 Jul at 09:14
Session TimeOut in web.xml
Session TimeOut in web.xml I am trying to understand the real purpose of session configuration in Web.xml for session timeout. Now let me tell you about my question. My application is importing/upload...
- Modified
- 26 Nov at 21:5
Get full URL and query string in Servlet for both HTTP and HTTPS requests
Get full URL and query string in Servlet for both HTTP and HTTPS requests I am writing a code which task is to retrieve a requested URL or full path. I've written this code: So, when I browse `http://...
- Modified
- 22 Jul at 14:9
Getting request payload from POST request in Java servlet
Getting request payload from POST request in Java servlet I have a javascript library that is sending a POST request to my Java servlet, but in the `doPost` method, I can't seem to get the contents of...
How do you store Java objects in HttpSession?
How do you store Java objects in HttpSession? So I am trying to get a servlet to add a Java object to the session of the user, when this servlet is requested. But after the servlet redirects to the ne...
- Modified
- 23 Apr at 20:32
Best way to manage database connection for a Java servlet
Best way to manage database connection for a Java servlet What is the best way to manage a database connection in a Java servlet? Currently, I simply open a connection in the `init()` function, and th...
- Modified
- 27 Oct at 21:41
Maven dependency for Servlet 3.0 API?
Maven dependency for Servlet 3.0 API? How can I tell Maven 2 to load the Servlet 3.0 API? I tried: I use [http://repository.jboss.com/maven2/](http://repository.jboss.com/maven2/) but what repository ...
- Modified
- 26 Sep at 13:24
Giving multiple URL patterns to Servlet Filter
Giving multiple URL patterns to Servlet Filter I am using a Servlet Filter in my JSF application. I have three groups of Web pages in my application, and I want to check Authentication for these pages...
- Modified
- 11 Jan at 04:58
Getting IP address of client
Getting IP address of client I am developing a web application using , (Container: ) in which I need to get clients `IP Address`. I am getting the clients IP address, because I want to give access to ...
- Modified
- 19 Jun at 01:41
Servlet Filter: How to get all the headers from servletRequest?
Servlet Filter: How to get all the headers from servletRequest? Here is how my `WebFilter` looks like ``` @WebFilter("/rest/*") public class AuthTokenValidatorFilter implements Filter { @Override ...
- Modified
- 11 Aug at 15:44
Change jsp on button click
Change jsp on button click I have a question. I have 3 jsp page. The first is a menu with 2 button. When I click the first button I want to open the second jsp page. When I click the second button I w...
How to test my servlet using JUnit
How to test my servlet using JUnit I have created a web system using Java Servlets and now want to make JUnit testing. My `dataManager` is just a basic piece of code that submits it to the database. H...
- Modified
- 30 Jan at 12:37
Tomcat 7.0.43 "INFO: Error parsing HTTP request header"
Tomcat 7.0.43 "INFO: Error parsing HTTP request header" I use Tomcat 7.0.43 with a websocket application. My app works fine in Tomcat 7.0.42 but with 43 I get the following output when I try to access...
Handling context-path refs when migrating "/" site to Java EE packaging
Handling context-path refs when migrating "/" site to Java EE packaging An existing Java site is designed to run under "/" on tomcat and there are many specific references to fixed absolute paths like...
- Modified
- 30 May at 22:19
Uri not Absolute exception getting while calling Restful Webservice
Uri not Absolute exception getting while calling Restful Webservice The below code snippet is using to call my web service using restful API. ``` ClientConfig config = new DefaultClientConfig(); Cli...
- Modified
- 13 Feb at 07:58