Suppose we have two servlets runing inside same war on same server. When user access servlet A and create a session, he then open another tab or browser to access servlet B (session created by servlet A still exist). Inside servlet B, does
I'm deployed application A and application B in TOMCAT server applications, the U1 user enters into the application A, he authenticates and generates a call to a page of the app B. As I was able to access the session of user U1 en A from B, it could have a single session.
Okay I am new to web-programming in general and am confused about how sessions work-:
1) Are sessions stored only on the client computer ? If so then if cookies are disabled then if browsers only store the session how are they able to remember the exact JSESSIONID ? Also how does the server (like Tomcat) remember which JSESSIONID belongs to which user ? Where does it store that information ?
2) If the server also stores the session information then how fast does it become out of date ?
3) If a client has cookies disabled does the server maintain a key-value pair of the IP and the session-id, so that if the same client logs in then the same session-id will be appended ?
4) When does the web-container make the decision of using cookies or the encodeURL() method to embed the session info ?
suppose a user logged in... after some time he want to get back to homepage...okk but suppose i want to get back to previous page by clicking back button on browser...but i dont want to go to login page until and unless i invalidate session...so wat settings i have to do on browser...so that i dont redirect to login page directly...
how this is done using session.setMaxInactiveInterval(); at first, i did not set anything but it expires anyway.so i'm trying not to let the session expire.session.setMaxInactiveInterval(0) does not work.
I am trying to use iText to create a PDF document. I found a nice tutorial online but one thing stumps me. How do I get the URL of the JSP page that contains the content? Since this will not be static, I don't want to hard code this. I am sure this is something simple but I am fairly new to servlets and JSP.
I tried to visit my webapp with /appinfo appended after the context url but I get a 404 and I see no errors in the GlassFish4 log.
My project is using JSF 2.x with the viewservlet mapped on *.xhtml and it is using Spring Beans as well (using the Spring Context Loader), mapped to /rest/*. Do I need to map something else?
I can only get this servlet working without annotations but only using the old web.xml way.
I don't know what I need to do to get my servlet working with annotations.
So that I can map the first request coming say www.xyz.net to my first page , it does the work but some of my css and images is not getting displayed .
I am new to Servlets and came across it in Head First Java 2nd Edition. I wrote the servlet code. I don't know how to run it. Do I need to set up a server?
I'm trying to go back to basic and strengthen some of my foundation. I'm wondering what kind of data would be appropriate to be stored inside a session? My app is a web app where all the users are the employee of a company. So it's an web-based app that keeps track of stock movements, purchasing and sales order (standard distributor company). The web app interacts strictly with employees, so no public facing app (yes, that's right, no shopping cart). So, in this kind of web app, what kind of data that by storing it to session.
I am calling a jsp page from my servlet using the requestdispatcher.forward(myjsp.jsp) method. myjsp.jsp is creating a new thread which is parallely processing along with the servlet. The issue is that the jsp page is not displayed until the servlet finishes its execution, although the new thread is created by jsp and is executing in parallel. How do we have the jsp page displayed even when the servlet is executing.
I have a secured Struts application in WebSphere that uses FORM j_security_check for authentication.There is also a Post Logon "filter" defined which runs some code after a login is processed.The extract from web.xml showing the login configuration and filter is as follows:
If a user isn't logged into the application and they try to access one of the secured servlets, for example quotes.do, they are directed to the login page to enter their information.If they login successfully, they are then directed to quotes.do, rather than the default "welcome" page. Is there a setting in the web.xml or the post logon filter where I can force j_security_check to ALWAYS go to the default welcome page after a successful login?
I need to encode the URL in order to prevent XSS security threat. I don't have to encode the complete URL, I just have to encode the values for query string. How to encode only the values of query string parameters and change it in the URL itself using java. I am planning to do this in a filter.
I am trying to finish this servlet that adds a new course to my courses display. im using a check box so the user can pick what the prerequisite are for the new course they want to add. so if they check cs201 , it will add cs201 as a prerequisite for that new course.
for some reason my checkbox will only add the first checkbox that is clicked. like if i add a subject , and click the check boxs for cs203 , cs202, and cs201. it will only grab cs201 and add it to my course display. it wont grab all 3. how can i grab the other info thats checked?
I am seen that ASP.NET apps have a handy feature called URL Routing. How will one implement this in Java without the use of heavy frameworks like Spring MVC ? How do you even begin writing a URL Router if there isn't anything available?
I did a Servlet and a JSP with a combobox. I called the JSP on one browser and selected value n1 from the combobox. From another computer, I called the (same URL) and selected value n2. I expected the Servlet to handled both requests separately, however when I select value n2 on the 2nd browser, the jsp on the 1st browser that initially had value 1, now changes into value 2 as well.
Why cant the servlet handle requests separately? users actions on different browsers should not interfere with each other..!
I am trying to build a basic online exam app.But not able to find out how to do that.So user will log in , click on start exam That will be handled by servlet , servlet should call Model class that will fetch questions from database and make a list of those questions and return it to servlet.Than servlet will set that list as an attribute.
and redirect to jsp , which will have three buttons previous ,next ,finish.on clicking on finish I will call servlet wichich will calla model class which returns users score and then servlet redirects to result.jsp.Is this way is right ?
I have good knowledge of servlet,jsp. I've also worked on mvc pattern and now looking to learn a web framework but i'm not sure which to choose between spring mvc OR struts.Should i first do struts and then go for spring or can i choose spring directly?
which works fine. The only issue is that I had to place this in the login page. Is there a way I can only set the path to the base url upon server start up?
A data entry form is on the front end. This allows one to enter say emails, addresses, etc. It utilizes a jsp, jstl, servlets, and beans. The backend sql has say a size of 50 for email. If more than 50 char are entered on the form, w/o any intervention, a truncation error is thrown. A static class was set up to hold the input element names and max sizes. It seems to work well keeping all in check, names and sizes on form, names in servlets, size of sql.
servlet .getInputElement("date").getInputName() //static map...shared with above objects
Is there any other system of keeping everything in sync. I am building it all, but I was wondering how this is parsed out if there are separate sql, middle-tier, and front-end developer? It seems better just to have good documentation that would be shared between the different implementers.