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 ...
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.
...
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=...
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 ...
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=" "/>...
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:
...
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"...
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...
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
...
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:...
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...
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.
...
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...
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();...
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}?
...
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...
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...
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...
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 ...
how to create singleton classes for multiple uses
and how to connect to jsp with that singleton class
...