Skip to main content

Posts

Showing posts with the label jsp

Image is not displayed on reterival

I have a table with Images stored in it as BLOB. I'm using JPA/Hibernate. So, that Images are mapped to a bean field with type blob. Now my Spring controller is returning entire list of bean (each object of this bean has a blob object) to my jsp. I want to display all the images on that jsp. So, I tried to use some thing like this on my jsp, <c:forEach items="${itemList}" var="item" varStatus="status" > <img src="<c:out value="${item.image}" />"/><br/> /*<img src="${item.image}"/> */ </c:forEach> but that is not working. Instead of getting the list of images displayed on jsp , I 'm getting the class name, when I view the page source I saw something like this <img src="java.object.serilizableBlob@2134"/> Please help me delve with the problem. How can I display all the images on same jsp.

Making a webserver using jsp and java

Using Google App Engine SDK: webpage: http://hwsejk.appspot.com/ I'm trying to make a web server using java and jsp (it is a web server for an iPhone application). I don't know a lot about java so I'm having a lot of troubles trying to construct a server by myself. For now, I have tried implementing cookie, database, and some other methods. Now that I've given you basic information about my web server, I have a few questions to ask. Is it the right approach to use java and jsp to make a web server like this? the java servlets get and send user inputs to different jsp pages, which contain some HTML and java code. But I've found some posts here that it's a bad practice to use jsp like this. I don't know how else I can make webpages. Could anyone please recommend the right approach to make a web server (like the one linked above)? I would love to know if there is some kind of a template that I can take a look at.

Ajax call response in struts. Response not reflected in jsp.

I am calling a struts action on using an ajax call. In it i am changing the values of some properties of the action class. The values are set properly but i am not able to reflect the changes in the jsp. The jsp code is as follows. <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <%@ taglib prefix="s" uri="/struts-tags"%> <html> <head> function findindex1() { var temp=document.getElementById("country").value; if(window.ActiveXObject){ request = new ActiveXObject("Microsoft.XMLHTTP"); } else if(window.XMLHttpRequest){ request = new XMLHttpRequest(); } request.onreadystatechange = showResult; request.open("POST",'temp.action?index='+temp,true); request.

How to retain a selected value in dynamically generated dropdown box to the next jsp page?

I have a drop down box where the options are coming from the configured properties file.The options are generated on load of the page.I have used the following code. In JSP <select name="IDNo" id="IDNo"> </select> function loading() { var d = document.getElementById("system"); var df=document.getElementById("IDNo"); var i = 0; var disp = document.getElementById("Range"); var numberOfOptions = df.options.length; for (i = 0; i < numberOfOptions; i++) { df.remove(0); } if (d.value == "Apple") { df.options[df.options.length] = new Option("ALL",""); for(i=1;i<=disp.value;i++) { var option = document.createElement("option"); option.text=i; option.value=

How to send a Javascript variable to server side?

I must add items to an existing code, but I do not know all the patterns established. I need to retrieve a value from a numeric field in javascript, store it in a JSP tag variable and submit it to a Java method. I know javascript is client side and the server-side Java. This is a numeric field "ZONE" whose value must be recovered for a loop The added code is input "ZONE", the Action buton "ADD_ELEMENT_LISTE_OUVERTE_1" and the variable and loop "zone". thanks ! JSP-side code: <popo:form> <div class="left"> nombre de colonnes <input type="number" id="zone" name="zone" class="text" maxlength="25" valeur="" /> </div> <div class="right"> <%controller.getContext().getInteger(ListeOuverteContributionDetailController.ZONE) =%> <script type="text/javascript"> function get