jsp

How to comment in jspx page

How to comment the code in jspx page? I have tried several methods, <!-- --> <%-- --> but it doesn't not work! So I have to: <c:if test="${false}">code</c:if>, it is really urgly, Is there any other ways? Any help is appreciated! ...

How to output "&" from jspx?

How can the below element be output from jspx? **&nsp;** , output space in jspx **if(a && a!=b)**, JavaScript file in jspx ...

JasperException: The value for the useBean class attribute is invalid

org.apache.jasper.JasperException: /index.jsp(1,1) The value for the useBean class attribute com.b5 is invalid. org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40) org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407) org.apache.jasper.compiler.ErrorDispatcher.jspError(...

How do I execute a sequence of servlets?

I am just beginning with Servlets and managed to have some servlets that act as individual URLs for populating a database for some dummy testing. Something of the form: public class Populate_ServletName extends HttpServlet { public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { resp.setContentTy...

Is there any specific available method in jsp/Servlet API which tell you from which page the request is being redirected.

I have been working in Oracle iStore from past 4 months and I have been managing the application without any IDE (basically doing all the chores on notepad only because application has been designed poorly and no IDE can support it). Since the coding is done on simple notepad files it is very hard to find out the bugs in the application...

How to use <c:out value=...> taglib

I have the class A: package a; public class A { private int x = 9; public int getX() { return x; } } and the ajsp.jsp file: <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional...

load table data on jsp using struts2 with fixed table structure

Hi. I want to have a fixed table structure on my jsp page(3row, 4column). but I want to load data for this table from DataBase with using struts 2. I know if my table structure wasn't fixed I could have just get a List and iterate on it and add a data in every iteration, but how could I do this in this case. also if I don't have enough...

How to create templates in JSTL JSP

Say I have a JSP page with JSTL. I'm using c:forEach and looping over 5 different sets of objects, each very similar. Each loop is nearly identical.. lots of duplicated code. I'd like to make that loop a template -- such as a JSP template, but I want to pass the JSTL object(s) in the parameters. How can I do this? Or a more general...

Unit testing JSPs

Hi, I would like to ask you what technologies exist out there for creating unit tests for JSPs. I am already aware of the HtmlUnit/HttpUnit/JWebUnit/Selenium possibilities. Thank you! ...

Should I add try/catch around when casting on an attribute of JSP implicit object?

Hi all: Basically what I mean is like this: List<String[]> routes = (List<String[]>)application.getAttribute("routes"); For the above code, it tries to get an attribute named "routes" from the JSP implicit object - application. But as everyone knows, after this line of code, routes may very well contains a null - which means this app...

Call HashMap from jsp EL ?

Here is my Entity Class public enum UnitType { HOSPITAL, HEALTHCENTER } public static LinkedHashMap<UnitType, String> unitType = new LinkedHashMap<UnitType, String>() { { put(UnitType.HEALTHCENTER, "Κέντρο Υγείας"); put(UnitType.HOSPITAL, "Νοσοκομείο"); } }; @Id @GeneratedValue(strategy = Generatio...

Appengine not compiling my .jspx files

I have a little app that runs fine on local dev appengine, but appengine itself is not processing my .jspx files. The jspx files are in WEB-INF so they should not be excluded by appengine (as a static resource) I am using Apache Tiles to define my views. So the html produced looks like this: <html xmlns:jsp="http://java.sun.com/...

Is existed web markup languages with possibility insert sql query?

Actually what I want - simple DB with simple User Interface. Like MS Access, but for web and it can be without Dragn n Drop, but described with markup language. For example if I want to create list report, then i need to write something like: <table query="SELECT * from mytable"></table> It needed for simple data applications. In that ki...

How can data be passed into an <s:> tag within a Struts tag file via attributes?

I have a form with two halves, one for attaching a wide thumbnail to an asset and one for a standard-size thumbnail. The jsp file generating the page calls thumbnail.tag, which calls thumb.tag twice: <thumbnail:thumb label="75px Thumbnail" /> <thumbnail:thumb label="Wide Thumbnail" /> thumb.tag in turn has the following: <s:if test="...

Include a JSP in Lotus web page

Hello, is there a way to include a jsp page (what it returns) into a lotus web page ? What I'd need is the equivalent of a <jsp:include url="...."> but to use on the lotus side (a "lotus tag" if that exists) The tag would give an HTML String back and would be used by Lotus. Please note that I don't know anything about Lotus, th...

How to disable GET requests to JSP page?

I am fixing some old defects and as part of one defect, I need to make sure that some requests are being only POST to the JSP page instead of a GET request. The application have a form which submits data to another JSP page (I know its wrong and against MVC but too late to fix it), since it is a JSP page, so we can POST the request or el...

User sign-up with email verification

Hi. I'm developing a website with using struts2 and jsp pages. In many sites after you sign-up, a link will be sent to your email and after clicking on that the registration is complete. I want this feature on my webstie, but I don't have any idea how to do this and how is this working? Should I save user's information on my database un...

Get status of servlet request before the response is returned

Good evening, I am in the process of writing a Java Servlet (Struts 2, Tomcat, JSP etc) which is capable of doing some fairly complex simulations. These can take up to 2 minutes to complete on the and will return a graph of the results. It is trivial to calculate the percentage of the simulation completed because the process works by re...

Populating JavaScript Array from JSP List

Ok so perhaps someone can help me with a problem I'm trying to solve. Essentially I have a JSP page which gets a list of Country objects (from the method referenceData() from a Spring Portlet SimpleFormController, not entirely relevant but just mentioning in case it is). Each Country object has a Set of province objects and each province...

IE dynamic image caching issue?

I have an html page that is loading multiple iframes into which are embedded dynamic images created from a Tomcat server page (.jsp). This works as expected from Chrome and Firefox, but for some reason IE displays all of the images the same (as the first image). I've created an example: http://coupondiscounts.com/jsImageTest.html jsIma...