jsp

Pass array from my application to JS

Hi, I am developing an application in JSPs and Servlets, and I want to know if, and how it is possible to pass an array from my application in to some javascript so that i can use the Autocomplete feature from the jquery ui library. Thanks in Advance Dean ...

Maintaining a list of Objects on a JSP page

Hi, I have been developing a piece of simulation software using Struts 1.3/JSP. I am trying to find a way to display of list of objects on my JSP page which can be added to/deleted from. I actually have a list of chemical steps, each step has a list of product and reactant species (species is also a java object) This is the Step class...

Get Server IP address from JSP Request/session object

How can I get the IP address of the server from a JSP page? Right now, all I can do is request.getLocalName(), which returns the server name, not the IP address? ...

Is there a way for a java program to know which platform it is currently running in?

Is there a way for a java program (or more specifically java in jsp) to find out which platform (windows or linux) it is currently running in? Thanks in advance. ...

How to avoid Java Code in JSP-Files?

I'm new to Java EE and I know that something like the following three lines <%= x+1 ?> <%= request.getParameter("name") %> <%! counter++; %> is an oldschool way of coding and in JSP Version 2 exists a method to avoid Java Code in JSP-Files. Can someone please tell me the alternative JSP2 lines, and how this technique is called. ...

iterating through java collection using jQuery

I am starting with this object, public class myTO { private String id; private String name; } Which is used in this object public myCombiTO { private myTO myTO; private List<String> valueList; private List<String> displayList; } I create a list of these objects List<myCombiTO> myCombiTOList = getMyCombiTO...

Handling Spanish characters in Java/JSP

I have a small webapp which handles a lot of Spanish text. At one point in the code, a JSP page responds with a Json String containing some of this text. If I print the String to the Console, it looks like jibberish. But if I examine the header/content of the response in Chrome Developer Tools, it looks correct. It is transferred in the...

What is the best way to edit those 1 pixel background images?

Hi all, I got my colleague's web page together with and the css files and many images. I need to apply part of it to my jsp page. I have to admit that I didn't have any experience in handling css. Currently I am using GIMP2 to edit those 1-pixel-width background images. It's really the pain in the neck. I have to guess the proper image s...

Sharing values in session between .jsp pages in OC4J

I am developing a web server with multiple .jsp pages. OC4J (10.1.3.1) is being used. But I found that Parameters, that are saved in session in a .jsp page, cannot be retrieved in another .jsp page Is there any hint ? FYI, OC4J is not customized by any means ... ...

multiple radio button selection

I've to display many groups and many products under each group. For displying them I'm using JSTL to iterate the list of products from the list of groups. User can select one product from each group by clicking on the radio. To enable this i've added the id of the group with the radio name, so that user can select multiple radios. Ho...

Create a PDF From a JSP Output

I have a webpage with a export option to PDF. I have to display the contents of the page in the PDF. Currently I use iText PDF Library to generate PDFs. The problem is creating PDF with iText is quite a challenge. Moreover we get frequent layout/UI changes for the webpage, so we have make the same changes to PDF. Is there any way...

how to navigate through icefaces jsp portlet pages?

I'm trying to navigate through pages in icefaces portlet(Liferay) but I can't get it to work. <navigation-rule> <from-view-id>/AdmissionApplication/Application.iface</from-view-id> <navigation-case> <from-outcome>y</from-outcome> <to-view-id>/StudentPage/StudentMainPage.iface</to-view-id> </navigation-case> </navigation-rule> and her...

Submit image in a <form> to a different domain?

Hi, I've got a web project where my users signup at a url like: www.mysite.com/signup/index.jsp after the user signs up, I show them another page where they can submit a user photo if they want. But my user photos are going to be hosted at another domain I own - is it possible to post a form to another domain? Like the page they land...

Transfer images between servers?

Hi, I have a java servlet which accepts an image a user uploads to my web app. I have another server (running php) which will host all the images. How can I get an image from my jsp server to my php server? The flow would be something like: public class ServletImgUpload extends HttpServlet { public void doPost(HttpServletReque...

Effective way to handle singular/plural word based on some collection size

There are many instances in my work projects where I need to display the size of some collection in a sentence. For example, if the collection's size is 5, it will say "5 users". If it is size of 1 or 0, it will say "1 user" or "0 user". Right now, I'm doing it with if-else statement to determine whether to print the "s" or not, which is...

JSP EL String concatenation

How do I concatenate strings in EL? I want to do something like this but it doesn't work: ${var1 == 0 ? 'hi' : 'hello ' + var2} It throws an exception trying to cast 'hello' to a Double ...

Languages / stacks for deployment

I'm working on a rather intensive rewrite and given a choice of the following options: JSP / Java running on Tomcat PHP running under Apache Ruby (running under I'm not sure, ROR?) A couple of basic questions I would like to know about the above. Speed is a concern. We have a MongoDB backed database, so we shouldn't need to be waiti...

Session in OC4J (9.0.4.1) and OC4J (10.1.3.1)

I wrote a very simple JSP file in order to check the Session in OC4J (9.0.4.1) and OC4J (10.1.3.1). I found that: [OC4J 10.1.3.1] Session keeps changing when web page is REFRESHED [OC4J 9.0.4.1] Session is maintained even web page is REFRESHED Anyone has clue to solve this issue ? The source codes are as follows: Session ID is ...

How to display buildnumber in spring-based web application

I need to display build number in my index.jsp page <!DOCTYPE HTML> <html> <head> <meta charset="UTF-8" /> <title>Title (build: BUILDNUMBER ) </head> The build number can be supplied by maven into a *.properties file. What is the best way to read *.properties file and display a property with Spring? ...

jsp coding problem

I am a programmer, new to jsp, trying to write some code. i have written like <% int i=1; String connectionURL = "jdbc:mysql://localhost:3306/registration"; Connection connection = null; Statement stmt = null; ResultSet rset = null; Statement stmt1 = null; ResultSet rset1 = nu...