I've created a web app that uses OAuthentication to log in to Twitter and the login process works successfully on a single servlet. On that servlet I get the session for the user. However, once I move to another servlet for the first time and try to get the session again, a new one is created. I thought the web app would read client co...
Is there a way to determine the number of active sessions created from a given client IP address?
...
Hi all,
How do you force a download prompt to popup before you send any data to browser? I know about content disposition attachment, but this is different. Basically, the servlet starts sending data to the client, and then the client open a dialog, open, save, cancel.
The probably is my servlet is slow getting the data, and it gets ...
I want to initialize a global instance of a class before my Tomcat server completes startup and begins to offer my servlets. If this service somehow fails initialization, I'd like the entire startup sequence to fail as well (or as close to this as possible; it would be pointless for the server to be running otherwise). What's the best ...
I have a webapp running on tomcat using a JndiRealm and form authentication. I would like to add a "remember me" checkbox to that form. What is the best way to do this?
...
I have some dynamically generated jsp content I'd like to (jstl) c:import into another jsp page. Currently I have the dynamically generated jsp written to a file in the servlet temp directory (javax.servlet.context.tempdir) but can't work out how I can import it since it is outside the servlet context.
Is there a way to import a jsp from...
I am using JSF 1.2 without any component libs for a JSF Application. Consider a case where I have a JSF rendered page and on click of a link in that page,a pop-up page should open and show some details which are from the backing bean? What are the options? since the pop up page is just a look up (read only data) , I am thinking to use ja...
All the online references and head first JSP&Servlet book I'm reading state the characteristic of RequestDispatcher and Redirect (i.e. resoponse.sendRedirect() ) like:
"Request Dispatcher" - URL in the browser bar does not change.
"Redirect" - The user sees the new URL in the browser.
But according to my test, for RequestDispatcher, I...
When should an object (i.e. an application-wide properties file) be kept in the session, as opposed to creating a singleton to keep it? When should each of these approaches be used?
Note: I am working on a clustered environment, if that makes any difference.
...
How can a filter be mapped to the root of a URL? I'm using Tomcat 7.0.2 and deploying an application as ROOT.war. The welcome page is sign_in.xhtml. I would like to run a filter whenever the client sends a request for the root of the site (i.e. the domain name only), or when the the client requests sign_in.xhtml. Here is what I have s...
If I have a complex object with hundreds of String fields and objects of objects. Some are implementing Serializable and some aren't.
How would a j2ee server serialize that data in session. Would I expect all data to be returned. Even the objects of objects.
Session.setAttribute(data)
E.g. Session.getAttribute() == data.getData().g...
In our JSP pages, we use extensively. Works great, rewrites the URL to deal with sessionids, contexts, etc. But now we need to do some of this work inside a class that takes an HttpServletRequest and HttpServletResponse as part of the Spring Security specification.
How do I apply a type transformation to a path in a servlet? I gues...
Hi,
I setup my Session time out.
<session-config>
<session-timeout>11520</session-timeout>
</session-config>
Each time when I close the browser and open it again by calling the servlet, I see that new session is created. It can be seen from SessionCreated method executed in HttpSessionListener each time when browser reopened.
I'm...
Up to now, <mvc:annotation-driven /> has caused plenty of trouble for me, so I would like to get rid of it. Although the spring framework docs clearly say what it is supposed to be doing, a listing of tags actually summar <mvc:annotation-driven /> is lacking.
So I'm stuck with removing <mvc:annotation-driven /> and now getting the erro...
I've been following the google app engine tutorial and the part that explains JDO is done under the basis of a guestbook. So when they query the persistence (BigTable i believe) they are interested in returning all the results.
I'm trying to adapt this for showing the results for the specific user but seem to be having trouble with it.
...
I configured my Spring web app with a servlet to serve images at the URL:
/imgsrv?imgid=12345
I also have Sitemesh installed and now when I call this image servlet, I get a decorator exception related to this servlet, which does not need a decorator applied to it.
According to the Sitemesh docs, you can exclude certain URLs from havi...
I am learning Servlets concept. Initially, I Tutorial referred to this link and working on the HelloWorld example.
On submission of the JSP form with the name and age I get the following errors. Kindly advise on what has to be done.
The locations of my files placed are as follows,
C:\Program Files\Apache Software Foundation\Tomcat 5.5...
I have a JSP form which is made of <input type="file"/> tag alone for allowing the user to browse and select the excel sheet.
Am going to write a servlet program for uploading the file that is selected to the server.
My questions here are,
Which method must be used in the servlet program to receiving the file and processing? Such as ...
We usually get servlet-api.jar along with web/app server. So does it mean each one have it's own implementation of servlet JSR or will they use SUN provided api.
Does this applicable to all other J2ee API's like
EJB
JMS
MAIL
Thanks,
Student
...
Hi,
my java skills are a bit rusty and I'm wondering how I can implement Open Session In View pattern for the PersistenceManager called from a servlet in a google app engine environment.
I have some singleton which handles the PersistenceManagerFactory, but how can I get a "new" PersistenceManager at each servlet call ?
I want my bus...