jsp

java: how do I create an array of tuples

how can I create an array of tuples in jsp (java) like (a:1, b:2) (c:3, d:4) ... ... ...

How to pass values from client side to server side ?

Hi All, I got a situation to transfer values from jsp to servlet's action class. Previously we did it using <input type="hidden" id="name" value="manoj" /> we take this value in action class by request.getParameter("name"). But now we couldn't pass value like "Hi\n i am\n Manoj". Since it has new line included in the string we...

JSP: I am doing an application in which i have to download ppt file .

I am working on an application wherein I have to download a PPT file using a JSP page. I am using the following code, but it's not working. <% try { String filename = "file/abc.ppt"; // set the http content type to "APPLICATION/OCTET-STREAM response.setContentType("APPLICATION/OCTET-STREAM"); // initialize the http content...

populating html table from database

Hi everyone, I want to generate html table in my jsp witch display values selected before submitting to allow user to know what did he puts into the form. So I finish the form when submitting the values are inserted in database. Now I search the possibility to display in the same jsp of the form the table having all the values selected....

Servlet's doGet not called from JSP form

I have this code on my JSP page <form action="LoginServlet" method="get"> <input type="text" name="username" /> <input type="text" name="password" /> <input type="submit" value="Submit" /> </form> and when I press Submit I get: The page cannot be displayed The page you are looking for is currently unavailable. T...

Mixing JSP/HTML any new features or suggestions

Hi all, I guess my questions are not well described. Is this coding style (like the example below) still recommended? Aren't there any new methods of mixing html with jsp? I see some examples with the blockquote < script > < /script >. I guess that's for seperating code blockwise and not always the best way. Any suggestions, let's say...

Beans, Lists and JSP

Hi at All I have a little question... On my JSP page I have a List of beans. I want to extract a sublist of beans with a specific property (Ex. all Horror books). Can Apache Beanutils help me? Thanks in advance... ...

Development deployment: how to achive edit-and-reload with JSP pages?

Out project uses WebLogic as web-server and uses mostly JSP for user interface. With standard setup it is possible to copy edited JSP files into the exploded deployment directory and WebLogic will automatically pick them up, recompile and serve new content through HTTP. However, is it possible to avoid copying at all, so that I just sa...

Problem in displaying image in FireFox

Hello friends, I have a JSP page on which I have a div tag in which there is a a IMG tag. Using this IMG tag I want to show an image in it. Here the source path of an image is comes from database so I assigned a JSP variable using JSP scriplet. This JSP variable have the source path of an image. This path of image may be of differen...

Pure JSP page navigation best practice?

What's the best way I can implement navigation links between various JSP pages of my Web app? Suppose that I have a list.jsp that shows a list of items. Then the user clicks on one of these items to view the item in more details in view.jsp. Now I need a link from view.jsp back to list.jsp. However, list.jsp is not the only page that co...

displaying special characters in hyperlink text

I have used HTML in my Java class and in one case I have used <a href="...">username</a>. Username is a variable that gets values dynamically. In one case its value is 'rg@bg' but here instead of the name I'm getting the URL to which it is directed in my jsp. How do I ensure that the value of username comes on the display page as it is. ...

contextpath is appended

dear all, i have created one hyperlink, and by clicking on that i am redirecting the page to another JSP, but i am not getting the correct URL that i am passing, URL is appended with another string and the page is not redirected, please anybody have any idea about that, help me out <td align='<%=lstrColAlign%>' class="<%=tdclass%> ...

Printing UTF-16 strings in JSP is outputted as HTML encoding (&#xxxx)

Hello, When I try to print a UTF-16 string in JSP, specifically Hebrew, it ends up showing up as HTML encoding (&#xxxx). This problem occurs because I print an array of variables into the web page and then parse them. The variables are all UTF-16 strings, but once the servlet prints the variables, it becomes translated to HTML encoding....

How can I map a spring controller to a url with .jsp extension?

Hi. We are in the process of migrating a jsp-only application to Spring-MVC. For various reasons we can't change the extension of the current pages. (calls to login.jsp need to handled by a spring controller that will use a jsp file as view). We are doing this iteratively, so some pages need to stay jsp files (calls to welcome.jsp won'...

url redirection

Hi, I need some help with regards to the url redirection. Here is the problem. We have a website with a section as http://www.site.com/sectionxxx/index.jsp we have another domain http://www.sectionxxx.com. The task is to forward any request comming for the http://www.sectionxxx.com; direct to http://www.site.com/sectionxxx/index.jsp....

Dispaly the UserName and the localTime in a JSP

Hi, I am working in a JSP/Servlet project (J2EE) with Eclipse. Actually i want to dispaly the current user logged in the page and the localTime. My JSP of LOG IN worked well but I have no idea how to display the user name in the jsp where he is logged. Thanks for help. ...

html body inside if condition

Hi, i have two different bodies for different conditions. can i do like this.... <% if(yes) %> <body onload="JavaScript:timedRefresh(120000);"> <% } else { %> <body> <% } %> Please help me... Thanks in advance.. I want to compare my title in if condition how can i do??? currently i am doing like this: <head> <title> <tiles:getA...

Get the selected value from a Select box and check that value against an array in the same form

I'm new to JSTL/EL and JSP and can't seem to find a reference which covers the following scenario: I have an array of values in JavaScipt: var Countries = ('US', 'CA'); I then need to check to see if the currently selected value of a standard HTML select box is in that array. This is what I have so far: <select id="shippingCountry...

How can I extend Eclipse Java search to JSPs?

Friends, Our JSP code uses both Spring form tags and JSTL tags. Is there a way that when I search for getFoo() in the Eclipse Java Search, for Eclipse to also return uses of the foo property in the JSP files? I suspect the answer is "no", because there isn't a way at compile time to tell the types of the JSP beans, but its worth asking...

spring-mvc binding arraylist in form

In my controller I added an ArrayList to my model with the attribute name "users". Now I looked around and this is the method I found (including a question here): <form:form action="../user/edit" method="post" modelAttribute="users"> <table> <c:forEach var="user" items="${users}" varStatus="counter"> ...