jsp

how to use the image file located in local drive, for printing it in jsp page or servlet page?

I want to display the image located in my local drive. I am using sun java app server 8. For example If I generate a file abc.jpg dynamically and store it in c:\abc.jpg, then how could I use it in jsp or servlets? How to display it in the jsp or servlet pages? I know giving the path c:\abc.jpg in coding to display image wont work , becau...

Why my jsp changes are not reflected without restarting tomcat?

I am editing the jsp files which are residing directly inside tomcat/webapps/myapp/web-inf. But to see the changes i have to restart the server these. As far as i know, jsp changes don't require you to restart the server. The only configuration i found which was related to automatic reloading is reloadable = "true" Set to true if you...

JSF Form and German Umlauts

Hi there, I'm facing a strange problem in one of my JSF (which is a facelet). I'm using Richfaces and on one page I got a normal form <h:form></h:form> My problem is when I submit the form all UTF-8 chars - like german umlauts (äöü) - are recieved encrypted. If I change the page to ISO-8859-1 on my browser it works. If I expand the ...

How can I reuse HTML/JSP within a page?

I'm new to JSP, and I'm trying to reduce a massive amount of cut-and-pasted code. On each page in the project, there are around 25 lines of mixed JSP,Struts tags,JSTL tags, and HTML, which have been cut and pasted at various points in the page. These ~25 lines of re-used code are not even remotely similar from page to page (and there ~25...

non-servlet JSP

I realise there are EL and near EL frameworks like StringTemplate, JUEL, Velocity, etc. However, I am not asking for list of alternatives to JSTL/EL. I came across a package more than a year ago, someone who wrote a util that emulates the functionality of JSP for non-servlet env, i.e., JSP composition which does not need a "servlet cont...

What harm is caused by java.lang.IllegalStateException: Response already committed

I continuously get below error on my weblogic 10.3 console logs java.lang.IllegalStateException: Response already committed at weblogic.servlet.internal.ServletResponseImpl.objectIfCommitted(ServletResponseImpl.java: 1462) at weblogic.servlet.internal.ServletResponseImpl.sendError(ServletResponseImpl.java:601) at org.apache.struts.actio...

The ultimate Java version table (J2EE, JEE, Servlet, JSP, JSTL)

I'm looking for a component break down of Java EE (or previously know as J2EE) and J2SE E.g. J2EE 1.3: Servlet 2.3, JSP 1.2. JSTL 1.0, ... J2EE 1.4: Servlet 2.4, JSP 2.0, JSTL 1.1, ... JEE 1.5: Servlet 2.5, JSP 2.1, JSTL 1.2, ... In a simple table It can be extracted from: http://java.sun.com/j2ee/1.3/docs/ , http://jav...

Design question - Redirecting URLs

I am a newbie servlet programmer. I am trying to do this right. I wrote a filter to intercept a servlet request and check if the URL needs the user to be logged in. If so the user gets directed to the login page. This is working. But then I want to redirect the user back the page he wanted to go to in the first place. What is the corre...

which tag to use if i want to select an option from dropdown as wel as i can insert my own option.

which tag to use if i want to select an option from dropdown as wel as i can insert my own option. so using jsp can i do it? i m able to fetch the complete list to serve as option but i want to insert my own option as wel. what is the convenient technique using jsp? i mean like the way we insert into text box. i have seen in some sites ...

can i insert my own option in select tag

which tag to use if i want to select an option from dropdown as wel as i can insert my own option. using jsp can i do it? i m able to fetch the complete list to serve as option but i want to insert my own option as wel. what is the convenient technique using jsp? i mean like the way we insert into text box. i have seen in some sites tha...

problem generating random no in java

i have written a code like this but it is giving exceptions.actually i want to generate a random value.save into the database and return the same to the user import java.math.BigInteger; import java.security.SecureRandom; public static String recoverpassword(String uid,String ans) { try { verifyans.setString(1,uid); ...

Mix HTML and JSF in a JSF subview

Hi. The problem I have today is about dealing with HTML in an included JSP, with JSF. So here's the situation : I use JSF 1.2 by IBM on RAD with Websphere v6.1 I have a custom component (from the company layer) to use tabs. And in order to have a cleaner code, I just want to separate the JSF code of each tab in a separated JSP, this way,...

GAE JSP and Facebook-api-java iframe fb_sig_* param

Hi, I am building facebook app using iFrame (using Google App Engine Java,JSP and Facebook-api-java), and when Facebook calls back to my website, I expect to get the fb_sig_* request params for the iFrame, but I get those params in HTTP referer header instead. When I use the php client, i get the fb_sig_* in the $[_GET] as expected. W...

jsp, servlets, faces and beans?

i´ve read a little about java's structure and could someone tell me if my view of all these components are correct: JSP corresponds a View Servlet corresponds a Controller Bean corresponds a Model Faces correspond layouts to render display is this roughly correct? ...

integrate ms access and mysql in java

Hi, I have a problem connecting to MS Access and MySQL using Java. My problem is that I cannot find the driver for MySQL. Here is my code: <%@ page import="java.sql.*" %> <% Connection odbcconn = null; Connection jdbcconn = null; PreparedStatement readsms = null; PreparedStatement updsms = null; ResultSet rsread = nul...

Have multiple submit buttons in a form and determine which was pressed in a controller

In my Spring application, I have a jsp that has a form where I want to have multiple submit buttons that go to the same controller. I need to be able to determine which button was pressed in the controller. The form displays a number of items to the user and they can select one of the items with the only difference being the ID of the ...

Is it possible to use JSP and PHP at the same time?

1 function is written in Java while the API of another function is written in PHP. So, is it possible to use JSP and PHP at the same time? ...

How to validate/syntax-check JSP taglibs?

At work I currently write a lot of custom JSP-Tags for our designers, which are written in JSP's XML flavour (rather than Java classes). When I typo'ed or made a mistake and try to load the TLDs or tag files, Tomcat always just throws the non-descript error: Could not add one or more tag libraries. Now I have to hunt around the taglib...

Logging every jsp:include

I want to log every <jsp:include> tag. Does the JavaServer Pages Standard Tag Library (JSTL) support logging and if so, how do I enable it? ...

SRTServletRes W WARNING: Cannot set header. Response already committed

WebSphere logs the warning message “SRTServletRes W WARNING: Cannot set header. Response already committed” for one JSP request. I need the respone headers later in my code. I did some research and understood that Servlet is trying to send more data to the output stream, but the stream is already been committed. I did not understand wh...