jsp

Access variable in jsp tag files inside a loop?

I try to create a jsp tag file, which will call a helper class to print the input object. So I created a file /WEB-INF/tags/formatter.tag <%@ tag import="package.Formatter"%> <%@ attribute name="value" required="true" type="java.lang.Object" %> <%=Formatter.format(pageContext.getAttribute("value"))%> So that I can call ...

what should be kept in mind while writing secured ajax code using jquery for jsp

i am currently working on a web application project for payroll. this site is public. i want to use jquery + ajax to implement certain functionality with server side lang as jsp. what are the guidelines helpful in writing a mature,secured code. ...

JSF/JSP mixing problem

In an simple web application I have to combine jsp with jsf (for a school assignment). I am using NetBeans 6.7.1. In my login page I have the following code: <html> <body> <form name="form" method="post" action="processuserinfo.jsp" > UserName: <input type="text" name = "username" value=""><br> Password: <input type=...

Access Map<Enum, Object> in JSTL

I have: public enum MyEnum{ One, Two, Three } From controller, I put in the model: HashMap<MyEnum, Long> map = new HashMap<MyEnum, Long>(); map.put(MyEnum.One, 1L); mav.addObject( "map", map); How do I in my JSTL access the object in the map for key enum MyEnum.One, in a neat way? ${map['One']} //does not seem to work... nor ...

struts 2, tiles 2 dynamic title

Hi Gurus, I am using tiles 2.0.6 as my template framework together with struts 2.1.6. I am writing a simple cms page and want to let the user to define the title of each html page. I have a title definition like this <definition name="base" template="/WEB-INF/jsp/templates/base.jsp"> <put-attribute name="title" value=" "/>...

Creating your own Validators in JSF 1.2 with Facelets 1.1.12

I was reviewing the following link and found out that javax.faces.webapp.ValidatorTag is deprecated and replaced by ValidatorELTag, however I can't seem to find any good information about this. I want to create a Regular Expression Validator which takes input: regex and error message. Meaning I would want to have a control like this: ...

Encapsulate menuItem with taglib, jsp, JS?

How could I encapsulate the authentication logic, the URL and the label of a Menu item when I make use of e.g. a Dojo MenuItem widget? What I currently have is this: <auth:isRole role="admin"> <div dojoType="widget.Menu.MenuItem"> <a href="<html:rewrite page="... complicated url ..."/>"> <bean:message key="label.goes.here"...

Object Request with JSP

Hi guys, I have a problem with a JSP file. I want to retrieve the header but I have an error: Une erreur s'est produite à la ligne: 45 dans le fichier jsp: /logTest.jsp Enumeration cannot be resolved to a type 42: String headerString = ""; 43: String name = ""; 44: 45: for (Enumeration en = request.getHeaderNames(); en.hasMoreElements...

Declare function in taglib that has an inner class in the signature

Let's say I want to declare a function that has this java signature: public static String getStatusString(ArticleAndStatus aas) { //... } and that ArticleAndStatus is an inner class of org.example.Outer. How would I declare it in a taglib? These both fail: <function> ... <function-signature>java.lang.String ...

Img embedding problem in Struts2 jsp page.

I have a page called home.jsp in my struts2 application. I have embedded a html (screencompany.html) page within this home.jsp. I am trying to embed an image within the html page. But the image is not loading. Please help me out. Im very new to struts2 and jsp. Here is the home.jsp code. <iframe id="displayFrame" src="http://localhost:...

How do I prevent empty GET variables from displaying in the URL

I'm having a bit of a weird situation here. I have a form that submits using the GET method for a search function. On the subsequent page after a search, all the variables are displayed in the URL even if they are empty. For example if I make a search for movie title equaling "hello," I'll get this: /GetResults?title=hello&year=&directo...

How to debug JSP running inside a portlet in WebSphere 5.0.2 with Intellij IDEA?

I'm trying to remote debug JSPs using "JSR45 Compatible Server" configuration type in IDEA. My breakpoints do work in *.java files (after some dark magic tweaks, though) but breakpoints inside JSP don't. I tried settings breakpoints inside or outside scriptlets, in tag invocations, etc - none worked. WebSphere 5.0.2 runs on java 1.3. ...

Session handling in a Struts application

Hi, I am facing an issue in handling an object in session. I store an object in the session like this.Assume object is the name of the object.I do this in my action class if(object!=null) { session.settAttribute("objectName",object); return mapping.findForward("success"); } else { return mapping.findForward("failure"); } I map both...

getParameter only returning part of the string

Kindly assist here, the getParameter is only printing the first portion of the String element in the tag. here is the select tag <select name="ActionSelect" id="ActionSelect" > <%Iterator itr;%> <% List data = (List) request.getAttribute("data"); for (itr = data.iterator(); itr.hasNext();) { String value = (String) itr.next();...

Converting values to unit prefixes in JSP page

How can I convert values to to other units in JSP page. For example if I get value 1001 and I want to only display 1K, or when I get 1 000 001 I would like to display 1M and not that long attribute, how can I do that, when I get Integer value to my jsp page for example ${myValue}? ...

How to access Struts DynaValidatorForm properties form JSP

I have a struts action which populates a field. public ActionForward appForm(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { DynaValidatorForm dyna = (DynaValidatorForm) form; String identifier = (String) request.getParameter("id"); ApplicationDTO app = ma...

Security with JSP/JavaBeans/Servlets/MySQL

Background A html page will ask the user to type their username and password. These are credentials for a MySQL database (i.e. they will be used in JDBC connection so that no password is physically stored in the files). On submit a servlet will be called which tries to connect to the database. If it can, the credentials are correct and...

JSP, JavaScript, and Java Objects

I'm new to JSPs so bare with me. I have a JSP where I'm using a javascript framework to build a chart using the Google Visualization API. My servlet is returning a sales hashmap object with year as the key and integer (sales number) as the value. My javascript uses the sales object to add data to the Google chart API which builds my ch...

Getting error when submitting form using SpringMVC and REST

Hello there, Created an online form in JSP using SpringMVC tag libraries. The controller for my form is a RESTful web service. The RESTful web service has two calls: (1) http://localhost:8080/myapp/applications/new This brings up the online form in the browser (this works). (2) http://localhost:8080/myapp/applications/create This ...

singletonclasses

how to create singleton classes for multiple uses and how to connect to jsp with that singleton class ...