jsp

Encrypt in JSP, Decrypt in PHP

Hi, I'm trying to implement a single-sign-on link from application written in JAVA, to another web app written in PHP. I'd like a way to encrypt the username in .JSP and then decrypt in PHP. I need to find functions matching functions that will allow this. ...

How to read in Database Connection parameters?? Web.xml or via Managed Bean??

I have a web application that will be run on a windows 2003 server box. A http link will launch the web application(a jsp form) and that application opens up an oracle database(in the constructor). Different users will be using this application and each user will be sending his or her own username, password as well as the servername and ...

How to POST multiple "record sets" from an HTML Form to JSP or a Java Servlet?

Does JSP or any related lightweight technology like JSTL perform HTTP POST "data grouping", or support form element "indexing" in the way PHP does? For example, you can create an HTML form with the following inputs: <input type="text" name="person[1][name]" /> <input type="text" name="person[1][age]" /> <input type="text" name="person[...

JSP to serve a zip corrupts the file

I'm having a problem trying to serve a zip file in a JSP. The zip file is always corrupt after it has finished downloading. I've tried a few different methods for reading and writing, and none of them seem to do the trick. I figure it is probably adding in ascii characters somewhere as the file will open and display all the filena...

Display different Tomcat error pages depending on URL of original request

I would like to use Tomcat's error-page directive to display various different error pages in response to various types of exceptions. However, I want the error page displayed to have different styling and content depending on the original request URL that resulted in the error. Specifically, I have an admin part of my web application,...

Escape apostrophe as \' with c:out JSP

I have an object field with person's last name. If I use ${person.lastName}, I get O'Brian If I use <c:out value="${person.lastName}"/> I get O'Brian Both outputs breaks the next jsp code in IE <a href="#" class="delete" onclick="if(confirm('<c:out value="${application.lastName}"/> ' + _('Are you sure you want to dele...

jsp:this refers to which object in jsp page 's jave code block <% %>?

i am using this reference in jsp .i am able to call functions like this.getServletConfig(); can anyone pls tell me for which servlet its returning servletconfig object.and which object its refering to? if it is servlet object it is refering to from which requestdispatch was dn to this jsp page. then it shd return value of these parame...

Installation of Jetty into Eclipse

Hi I've had Jetty recommended as a good container for fast and simple development, in my case, Java Server Faces. I wish to use it with my Eclipse IDE (Version: 3.4.1), but quite frankly, can't figure out how. I've tried various outdated plugins, only with large amounts of errors in return, so I'm hoping someone could guide me from dow...

Mapping--definition problem

Hi, could anyone please tell me the meaning of the word mapping in the following line: When you define a servlet for a JSP, you must also define mapping to the JSP page. Thanks in advance. ...

Standard action

Hi, I really don't understand why the following code in JSP is running fine, but as described in Head first book, it will show compile time error. <html><body> <jsp:useBean id="person" type="foo.Person" scope="request"> <jsp:setProperty name="person" property="name" value="Fred"/> </jsp:useBean> <jsp:getProperty name="person" prope...

Browser caching

Hi, I am developing a web site which uses lot of images.I would like to make all images are to be stored in browser's cache till some specified time.Now it is stored in browser's cache.However if we refresh the page in browser it is making request to server for particular resource.Server responds with 304 code(NOT MODIFIED).I want to av...

Implementing Progress bar.

I am trying to mock a progress bar on my jsp. I have included a gif file in div tag which is not displayed when page loads initially. I want to show the gif file when user submits the page. On submit huge database activities run in background. The problem that I am facing the the gif file loses its animation affect. Please help me ou...

Java webstart Security

What is the option in Java Webstart command line to skip the security check? This is for testing purposes only. javaws myfile.jar ...

Using Servlets and JSP together resulting in unexpected looping.

I'm trying to use Servlets as a controller layer and JSPs as a view layer. Many of the examples/tutorials I've read suggest doing somehting like this: public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // add something for the JSP to work on request.setAttribute("key", "v...

How can I map a "root" Servlet so that other scripts are still runnable?

I'm trying to build a Servlet that calls a JSP page similar to the following: public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException, ServletException { req.getRequestDispatcher("/WEB-INF/main.jsp").forward(req, resp); } I need this Servlet to respond to the domain's root (eg: http://example.com/) so...

Building a Java based stock trading application, need pointers for technologies to use

I am building an application in Java (with a jQuery frontend) that needs to talk to a third party application. it needs to update the interface every two seconds at the most. Would it be a good idea to use comets? If so, how do they fit into the picture? What other means/technologies can I use to make the application better? The appli...

How do you detect the URL in a Java Servlet when forwarding to JSP?

I have a servlet that looks something like this: public class ExampleServlet extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.getWriter().println(request.getPathInfo()); } } with a web.xml mapping like: <servlet> <servlet-name>exampl...

Connection reset exception while using Apache Tiles and Weblogic 9.2

We are using Apache Tiles to stitch the pages into a given JSP template. The applicatoin is built and deployed using Weblogic 9.2 In deployment environment we started facing the issue, where the following error is logged in our log file, 2009-06-23 10:50:41,984 [[ACTIVE] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuni...

How to save data upon http session invalidation through jsp / servlets?

To track user activity history on a web application, I am attempting to save some session data to a database when the session is invalidated. My initial approach was to store the data on a javabean with a session scope and have it dump its data to the database through the finalize method. I figured this wouldn't be a perfect solution du...

jsp:include in netbeans

I'm using JSF in NetBeans. All I want to do is to include a page within another page. But whatever I tried, and when I run the main page, I get no error but I can't see my included page in a main page. Why? My main page is: <jsp:root version="2.1" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xm...