jsp

Servlet.service() for servlet jsp threw exception java.lang.NullPointerException

i am getting below exception and tomcat hangs and my services are down. SEVERE: Servlet.service() for servlet jsp threw exception java.lang.NullPointerException at org.apache.jsp.search_005fresult_jsp._jspService(search_005fresult_jsp.java:86) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.ser...

<tiles:insertTemplate> is slow

There seems to be an overhead in when included file is very large. This has nothing to do with the contents of the file, just its size, the file has nothing but commented out text <tiles:insertTemplate template="/WEB-INF/very/large/file/with/nothing/but/comments.jsp"> </tiles:insertTemplate> Time to insertTemplate is proportionate ...

Can Struts 1 in XHTML mode have 2 forms submitting to the same action?

We're converting an older Struts 1.x app from HTML4 to XHTML1.1. To force compliance from the Struts tags, we're adding <html:xhtml /> to the top of our JSPs. After doing this, JSPs using <html:form method="post" action="/foo.do" styleId="bar"> threw the following error: Cannot specify "styleId" when in XHTML mode as the HTML "...

Jquery autocomplete function not always running

I have a simple textbox and autocomplete like so: <input id="tagQuery" size="25" type="text" class="tagsearchbox" name="tagQuery" style="vertical-align:middle" /> <script>$("#tagQuery").autocomplete("getAutoCompleteData.jsp");</script> getAutoCompleteData is a jsp file containing JUST this (atm): <% String query = request.getPa...

retrieval of multiple images from the database using jsp-servlet

Have a look at the following code snippet. response.setContentType("image/gif"); String url="jdbc:oracle:thin:@localhost:1521:xe"; String username="xyz"; String password="abc"; Class.forName("oracle.jdbc.driver.OracleDriver"); Connection conn=DriverManager.getConnection(url,username,password); String sql="Select name,description,im...

How can I create user tables for java like aspnet_regsql in asp.net?

How can I create user tables for java like aspnet_regsql in asp.net? ...

JSP:include is not rendering the included file

I just created a new IceFaces application and I'm trying to include a navigation bar in all of the pages. When I use the jsp:directive.include tag the file is included, but when I use jsp:include it does not seem to be loaded. In fact, when I check the HTML source code in my browser, it's like the included file was completely empty. I do...

compare resultset result with a variable

Hello All, I am having some difficulties in java while comparing between a variable and the next resultset. In my case, I want : if the temp variable = rs.next() then temp ="" else the rs.next() value should be displayed. This is because I am getting the Tname field many times, so I would like to retrieve it once. Here is my code wh...

In Java, can I consolidate two similar functions where uses JspWriter and the other PrintWriter?

I have the following class, which as you will see has rather a rather redundant formatNameAndAddress method: package hu.flux.helper; import java.io.PrintWriter; import javax.servlet.jsp.JspWriter; // A holder for formatting data public class NameAndAddress { public String firstName; public String middleName; public String lastNam...

Shouldn't a method that receives java.lang.Object as input also receive javax.servlet.jsp.JspWriter as input?

I wanted to consolidate two functions. After getting a viable solution, I decided to play with the code a bit further, and came up with this: package hu.flux.helper; import java.io.DataInputStream; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.PrintWriter; import java.i...

dynamically populating drop down menus in jsp

i am struck with a problem in jsp. in my form i have 2 drop down boxes. depending on the value selected in the first box (which is populated from DB), i have to populate the second box from the database. is it possible using jsp and javascript? i did try to retrieve the value selected in the first menu using javascript n pass it in d qu...

Do you take a big performance hit mixing JSP and Servlets?

From my understanding, JSPs are compiled anyway, so I would anticipate you'd get similar performance from both. I want to display a lot of data, and I'm thinking of using JSP for the basics and calling a servlet to generate the code for each row in the table. Unless there's a good way to generate the entire table with one call to the s...

Can implicit object application be used with EL in JSP 2.0?

is it possible to use the implicit object 'Application' using EL in JSP 2.0? For example, instead of <%=application.getInitParameter("appkey")%> I want an EL version. I know I can use JSTL initParam but wondering if there is a way with Application.. thanks. ...

websphere Deploy WAR

When we deploy WAR into tomcat it explode WAR, while deploying WAR in websphere dose it explode the WAR as well. because I have deployed WAR into websphere but it dose not exploded my WAR and if the WAR is not exploded the file resolver doe not works. ...

closing jsp window

hello; i have a jsp page that checks a query if the answer is true the program goes to a servlet page otherwise the program continue as planned my question is: if i do go to the servlet page how can i close the original jsp page from the servlet ...

send object from JSP to sevlet

Can i send object or bean instead of sending parameters in jsp request to servlet, if yes , How can i get the value from each input field and use it inside jsp. E.g: //define user object <jsp:useBean id="user" class="iug.edu.entities.UserBean"/> //here is the input inside fomr <input type="text" name="userName"/> //here jsp code , to...

Architecture of a Java EE web application

Hello! I want to realize the following scenario: The frontend is based on HTML5 / CSS3 / JavaScript (with a JavaScript framework like ExtJS or jQuery). I have full HTML pages with forms, buttons, text fields, which have submit buttons which should send the data to the webserver. On the other hand I also have a website in this web applic...

jsp attribute value-trying to use expressions to form attribute values

I am facing a basic problem in my jsp. I have a jsp. There is a div element that is part of a loop .So here x is a counter. I am trying something like below but this is not valid syntax. <% for (int x =0; x <5; x++) { %> <s:div theme="ajax" id = <%=x%> <s:form> <s:submit theme="ajax" targets = '<%=x%>' /> </s:for...

JSP form parameters disappear when I POST my form to another page.

If I leave the action attribute out of my form so it posts back to the same JSP I have no trouble reading the request parameters. However when I add an action attribute to handle the form with a separate JSP, the request parameters are null. Here's a short example (FormTest.jsp) that illustrates how I'm reading the request. <HTML> ...

Jsp attribute names

Hi, Is there a way to use jsp expressions to dynamically name elements like this: <% for (int x = 0; x < 5; x ++) {%> <div id ='<%=x%>' name = '<%=x%>'> //some data </div> <%}%> I am getting unterminated tag compile error on <%=x%>. What can be a solution/workaround for this? Thanks very much! ...