jGuru
Register Email     Password Forgot your
password?
HOME FAQS FORUMS DOWNLOADS ARTICLES PEERSCOPE LEARN

  Search   jGuru Search Help

View:
JSP FAQ Home Page

FAQ Manager is guru Byron Tymvios.

Few technologies are as effective as JavaServer Pages (JSP) in facilitating the separation of presentation from dynamic web content. JSP pages are secure, platform-independent, multithreaded, and best of all, make use of Java as a server-side scripting language.

What's New

How can I avoid making multiple HTTP calls for content that hasn't changed? Is it possible to cache it? Is there a way to set this in the header?
Java:API:Servlets:Performance, Java:API:JSP:Performance
Byron Tymvios, Aug 31, 2006
This can be achieved by using a filter. You can setup the filter in your web.xml to intercept the response and edit the HTTP headers for the specified...
What is the difference between RequestDispatcher's forward(ServletRequest request, ServletResponse response) method and HttpServletResponse's sendRedirect(String location) method?
Java:API:Servlets, Java:API:JSP
Byron Tymvios, Aug 31, 2006
The forward method of RequestDispatcher will forward the ServletRequest and ServletResponse that it is passed to the path that was specified in getR...
I want to run JSP files using the Tomcat server, where should I place my JSP files?
Java:API:JSP:Vendors:Tomcat
Byron Tymvios, Aug 29, 2006
Under the Tomcat root directory there will be a sub-directory named web-apps, all web applications running on this Tomcat server will reside there. Each...

What is the difference between HttpSession mySession=request.getSession(true) and HttpSession mySession=request.getSession()
Java:API:JSP:Sessions
Byron Tymvios, Aug 28, 2006
request.getSession() will return the current session and if one does not exist, a new session will be cretaed. request.getSession(true) will return...
How do I import my own java packages and classes for use in JSP pages? In what directory should they reside? How do I put them on the CLASSPATH?
Java:API:JSP
Byron Tymvios, Aug 28, 2006
If your classes are packaged in a jar file you can put the jar file into the WEB-INF/lib directory of your web application. If you have unpackaged classes...
What is the difference between request.getParameter() and request.getAttribute() ?
Java:API:Servlets, Java:API:JSP
Byron Tymvios, Aug 3, 2006
Ok, getParameter() first: Code: <html> <body> <form name="testForm" method="post" action="testJSP.jsp"> <input type="text"...
How can I print the stack trace of an Exception out to my JSP page?
Java:API:JSP
Byron Tymvios, Jul 31, 2006
To print a stack trace out to your JSP page, you need to wrap the implicit object 'out' in a printWriter and pass the object to the printStackTrace method...
What is the JSP equivalent to header("Location: login.php"); in PHP? I want to open a new page in the same window.
Java:API:JSP
Byron Tymvios, Jul 31, 2006
In JSP you would use response.sendRedirect("your/URL/here"); to redirect the client's browser to a different location.
How can I serve Word/Excel documents to a web client from JSP's and/or servlets?
Java:API:Servlets, Java:API:JSP
Byron Tymvios, Jul 31, 2006
This can be done by specifying the content type of the response, in servlets you use response.setContentType("mime/type"); and in jsp you use the directive...
How can I display different currencies in my JSP pages according to the location of the client.
Java:API:JSP
Byron Tymvios, Jun 28, 2006
You can do this by using the Locale of the user (which can be obtained from request.getLocale() and passing it to a NumberFormat object. You can then...
In an MVC architecture how can I pass a bean to my JSP page from my controller?
Java:API:JSP:Architecture
Byron Tymvios, Jun 12, 2006
You need to add the bean to your HttpServletRequest object using setAttribute(String name, Object yourObject); Then you need to obtain a handle to the...
Where can I get an open source implementation for a JSP-based shopping Cart (something on the lines of www.opencart.com)?
Java:API:JSP:Open Source:GNUJSP
Byron Tymvios, May 31, 2006
Have a look at JspCart developed by NeuroSpeech, it runs on Java 1.4, Tomcat 4.1.27 and MySQL 3.23a.
How can I implement the MVC design pattern using JSP?
Process:Patterns, Java:API:JSP:Architecture
Byron Tymvios, May 24, 2006
The MVC (Model View Controller) design pattern is a pattern/architecture that can be used by GUI's. It seperates the application's data, user interface...
Retrieving values from HTML form input elements in JSP.
Java:API:JSP
Byron Tymvios, May 22, 2006
To retrieve any value from an HTML Form element on a jsp page you need to use the implicit HttpServletRequest object's getParameter(String s) method....
How can I prevent my public JSP page from appearing within the search results of an engine like Google or Yahoo?
Java:API:JSP
Govind Seshadri PREMIUM, Jan 21, 2005
You can add a meta tag to the generated HTML content indicating that the page must not be indexed by the search engine's spider. <head> <meta...
What can be done using the session object once it has been invalidated? What can be done using the session object once it has been invalidated? The JSP spec is not very clear on this. Can I use...
Java:API:JSP:Sessions
Govind Seshadri PREMIUM, Jun 28, 2003
Once a session object has been invalidated, it is flagged for garbage collection and you no longer have access to it. You cannot ask the container to revalidate...
What is the scope of <%@ page errorPage="" %>? Does it get passed to jsp:forwarded pages? Does it get passed to jsp:included pages?
Java:API:JSP
Sandip Chitale PREMIUM, Jun 28, 2003
Well, I did some experimentation and found out that errorPage is passed on to forwarded and included pages. The forwaded or included page can always...
I have the same JNDIRealm used for authentication in different webapps. I would like to be able to "persist" user login between different webapps. In other words if user logs in to one %TOMCAT_HOME%/w...
Java:API:JSP:Vendors:Tomcat
Govind Seshadri PREMIUM, Jun 11, 2003
Yes, Tomcat 4 supports Single Sign On for webapps. Within conf/server.xml, uncomment the following line within your host element: <Valve classNa...
I am writing a simple jsp to retrieve and save from/to my MySQL db. My retrieve and save functions work great. Now, depending on the action in the browser, I would only like to invoke one of the methods....
Java:API:JSP:JavaScript
Adrian K PREMIUM, Jun 11, 2003
Here you are: <input type="hidden" id="hiddenInputField" name="hiddenInputField" value="initialValue"> <input type="button" onclick=...
Whenever I send a € (euro) sign to the server, I receive a ? at the server. How do I solve this problem?
Java:API:JSP
Carsten Eider, Jun 4, 2003
You should "escape" the eurosign by using &euro; to denote it. If this doesn't work, check the endcoding-settings of your jsp.
« previous beginning next »


Ask A Question



Related Links

JSP Forum

Sun's JSP home page

SUN's JSP-Interest mailing archive

IBM's "Introduction to JSP" online course

JSP Insider

Wish List
Features
About jGuru
Contact Us

 


internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs