jsp

This code is not submitting to a form? Why

Since I am using get I expect to see the submitted values appended to the queryString but instead all I see is the URL of the servlet being called with nothing added at the end. classes = new HashMap(); classes = (HashMap) request.getAttribute("classes"); %> classIds = new HashSet(); classIds = classes.keyS...

Enabling JavaServerPages Standard Tag Library (JSTL) in JSP

I feel like I am missing something - from what it seems, JSP comes out of the box with support for tags, as this question's answer shows (the guy was asking a pure-jsp question and got an answer involving tags). But if I try to run the given code <c:out value="${myString}"/> (with myString defined before, of course), the jsp just writ...

Struts 1 - problem in showing ActionMessages through a JSP page

I am using Struts 1.3.10. I am trying to display ActionMessage and ActionError set by Action class through a JSP page. The problem is that the ActionErrors are displaying well but ActionMessages are not displaying. When I debug the application, I found that the messages (reference variable of ActionMessages) contains messages. I also sa...

Optimized throughput of static content from app server

I am building a small web application that primarily needs to serve up protected static content -- some flash (.swf) files > 20MB -- from an application server (Websphere) that is front ended by a web server (Apache). Are there there any Websphere configuration settings that I should consider to optimized throughput? ...

How to call sql procedure from an html button?

Hey guys, my doubt is pretty simple to understand. I have a sql procedure that generates a util file as its output depending on the input parameters that are passed to it. I have to pass these parameters from an html page from 3 text boxes.There will also be a button ,on clicking which, the procedure will be called and the util will be...

Java webapp: adding a content-disposition header to force browsers "save as" behavior

Even though it's not part of HTTP 1.1/RFC2616 webapps that wish to force a resource to be downloaded (rather than displayed) in a browser can use the Content-Disposition header like this: Content-Disposition: attachment; filename=FILENAME Even tough it's only defined in RFC2183 and not part of HTTP 1.1 it works in most web browsers as...

How to get multiple selected values from select box in JSP?

I have a html form which have a select list box from which you can select multiple values because its multiple property is set to multiple. Consider form method is get method. The html code for form is as follows. <html> <head> <title>Untitled Document</title> </head> <body> <form id="form1" name="form1" method="get" action="display.jsp...

session object returning null

i have created a login page for my project "student information system" which contain text fields username,userid and password.i tried to store the value of username and userid in session object and use it in another page but it is returning null value. ...

How to run a shell from Jsp?

Hey guys, my question is self explanatory. I want to run a shell,thats calling a procedure, from a jsp using a button. The procedure is CREATE OR REPLACE PROCEDURE DEMO_PRC (dist IN variable,mrno IN variable, yr IN variable,flags OUT number) IS begin flags:=0; // CODE THAT GENERATES A UTIL..... flags:=1; end; / And the shell is: sq...

Is it possible to create custom attribute in jsp tag library without defining setter method?

Hi All, I don't want to change the java code whenever there is addition of tag if the business logic will be remain same. I can access it by using Enumeration set of attributes(request.getAttributeNames()). e.g. <car:built maker="ford" wheel="four" name="endeavor" engine="dohc" power="72bhp" tyre="4" interior="mobile-charger,cigrat...

Updating a JSP with messages received in Java (writing a messenger client)

Hi all, this is my first question here - hope I'll get started on a positive note. Refrasing (since I am still stuck): I am writing a IM client via the XMPP protocol to connect to a Openfire server. For this I am using the Smack API. There are two ways of checking if new messages have been received: registering a listener with the XMP...

weird error in IE in central error page using jsp:include J2EE app

I dont have exact words how to explain this error in IE but will try best...here goes. I've following in web.xml <error-page> <exception-type>javax.servlet.ServletException</exception-type> <location>/errorpages/Error.jsp</location> </error-page> So whenever that exception happens in the application, we go to /errorpages/...

Failing import in on-the-fly JSP compilation

We have a large web app installation, using Apache/Tomcat/Jasper and jboss. In development environment, JSPs are compiled on the fly. Unfortunately, there is one package in particular that the on-the-fly compilation cannot seem to import. For some of the classes, using fully-qualified references rather than imports works, but not for ...

Communication between JSP and Servlet?

I have a jsp page that communicate with a servlet back end. Up until now, the way I communicate with that servlet is via .getJSON() which is a JQuery method. This work great if the data I want to send back is in the form of {key:value}. However, now I need to send a bit more data then that. The largest table in my database, contain rough...

How to reset a portlet parameter on a button click?

I have a Liferay portlet param "cmd" in my JSP page, which is initialized to a value "update". I need this value to be get changed to "delete", when a user clicks on the delete button of the form. How I can go about it? <liferay-portlet:actionURL varImpl="edit_survey_form_action"> <portlet:param name="cmd" value="update" /> <input...

Passing multiple data values from one JSP to another

I want to pass data in multiple rows belongs to the same column id from one JSP page to another. When i use request.getParameter("Name of the column id") it retrieves only the first row. How can i get values entered into all rows to my second JSP page? ...

how to catch and throw errors in JSP

I asked a question along similar lines yesterday as well. In that question I was suggested to have a global filter (which I already had). So I have a JSP like below ....code...code ..tags...html...code Object [] res = iBatisDAO.getReport_pging(null,null,0,null); //call to DB ...more code... ...tags...end In the above code I am intent...

How to iterate map in a list best way

The spring JDBC template returns me a list which looks like below: [{CODE_C=CSC, DESC_C=CSC}, {CODE_C=PG1, DESC_C=PG1}] I want the above list to printed in jsp as below: CSC-CSC PG1-PG1 Can you tell me the best way to do this? ...

How to upload files in JSP/Servlet?

How can I parse an uploaded file using Apache Common FileUpload? I tried this: FileItemFactory factory = new DiskFileItemFactory(); ServletFileUpload upload = new ServletFileUpload(factory); List items = upload.parseRequest(request); // This line is where it died. Unfortunately, the servlet threw an exception without a clear message a...

Jsp page getting called from cache rather than getting loaded from server

I am calling a jsp based on 2 parameters which is passed from jsp 1 in this way.Below i pass 2 parameters into 2.jsp and based on these 2 parameters data is displayed in 2.jsp.I have a loop in which i have a number of hrefs like the one i have described below.Each of these href passes a different set of value to 2.jsp. out.println("<a h...