Attribute 1 « API « JSP-Servlet Q&A

1. Conditionally set an attribute on an element with JSP Documents (JSPX)

In HTML forms, buttons can be disabled by defining the "disabled" attribute on them, with any value:

<button name="btn1" disabled="disabled">Hello</button>
If a button is to be enabled, the attribute should not exist as ...

2. What are attributes?

Could anyone please clarify the defination of attribute? for example, in the following code, what is an attribute:

request.setAttribute("ja",new foo.Employee());
Is the attribute in the above code an object of type foo.Employee(), or it ...

3. Problem in interpreting dynamic attributes in Jsp

I'm trying to process dynamic attributes in Jsp, but I'm getting display nothing in response. Here's the JSP code:

<%@ taglib prefix="c" uri="" %>
<%@ taglib prefix="mine" uri="DiceFunctions" %>


<mine:advice  suggest="yo haa haa" >

The ...

4. Why not SingleThreadModel synchronizing the attributes?

I'm a little confused by the following paragraph: "The effect of implementing SingleThreadModel is virtually the same as synchronizing the service method. Both can bring a web app to its knees without ...

5. Eclipse extension point for attribute content in JSP editor (webtools)

I am trying to find extension point for providing custom attribute values in JSP editors, similar to org.eclipse.jdt.ui.javaCompletionProposalComputer in JDT. I looked at WST and JST documentation referenced at, ...

6. JSP - Expecting "jsp:param" standard action with "name" and "value" attributes

I am using struts1.1. When i redirect to one jsp file, i got the following exception. I cannot figure out where the error is.

org.apache.jasper.JasperException: /jsp/jobcard/JobCardAdd.jsp(908,3) Expecting "jsp:param" standard action with "name" ...

7. Why are there magic attributes exposed in the Servlet spec?

It's always seemed a little at odds with the principles of Java that the Java Servlet Spec (2.5 version here) includes a set of magic attributes containing info about ...

8. Is there a way to iterate through HttpServletRequest.getAttributeNames() more than once?

I'm trying to log the contents of the HttpServletRequest attributes collection. I need to do this when the servlet first starts, and again right before the servlet is finished. ...

9. Jsp attribute names

Is there a way to use jsp expressions to dynamically name elements like this:

<% for (int x = 0; x < 5; x ++) {%>

<div id ='<%=x%>' name = '<%=x%>'>

//some data


I ...

10. How to print the value of an attribute in jsp/dom

I'm trying to print out an attribute value with the following code:

ArrayList arrayList=new ArrayList(); 
String  = "tagToFind";
Node n = node.getParentNode();
String printOut = "";
while (n != null && !n.getNodeName().equals(tagToFind)) {  ...

11. unable to put style attribute in out.print()

Possible Duplicate:
style attribute in out.print()
            <div id="result">

12. style attribute in out.print()

out.print("<tr style='border-bottom: dotted; border-top:dotted;border-color:black;'>");


13. Get value of attributes from pdf4ml using JSP

I am using pdf4ml for converting HTML to pdf, in which I have a line called pageNumberTemplate="$[page] of $[total]" I want to get the value of $[total] and $[page] in ...

14. How to get login attributes from a servlet/jsp

Lately I've been working on implementing security for my web application, running on a Glassfish v3. I successfully managed to secure some resources by setting a basic authentication up like following:

Now ...

16. Access MANIFEST.MF attributes from jsp or servlet

Possible Duplicate:
How do I read the manifest file for a webapp running in apache tomcat?
Is there a way to access the attributes of the ...

17. get xml root attribute as String in JSP

Anyone have a quick and simple way to get an attribute from the root node of an xml document as a String? I want to then be able to use this ...

18. Trouble setting Style attributes in XSL FO while generating reports

I am trying to generate reports from my JSP application and am having trouble with some of the style properties. My code looks like this:

<fo:block font-size="8pt" font-family="sans-serif" line-height="12pt"  space-before.optimum="15pt"  ...

19. How to access element attributes using JSP and XML?

Do you want to deliver high quality vidoe to your class? This tool will enable you to load video content quickly and easily. ...

20. Netbeans JSP Error: Cannot Find a setter method for the attribute

I am using netbeans 6.9.1. I have two netbeans projects: a project for my Java source files and a project for my web pages. The web file project has the Java source file project added in the compile tab in the web project's project properties. I have no problems running the web project under tomcat and netbeans correctly copies all of ...

21. pageEnconding attribute?

Originally posted by darine darine: >>> 1- is pageEnconding is a valid attribute of page directive? As of JSP 1.2 specification, yes. It's not in the JSP 1.1 syntax card (see syntax cards for JSP 1.1 and JSP 1.2 at ). Make sure your Servlet/JSP engine supports JSP 1.2 >>> 2-Attribute flush of jsp include action is a mandatory attribute? In ...

22. 'page' attribute in jsp:include

I don't know if anybody had gone through the Sun's JSP specifications. I have a doubt in it. The Specification says " The 'page' attribute of both jsp:include and jsp:forward are interpreted relative to the current JSP page, while 'file' attribute in an include directive is interpreted relative to the current JSP file" Can anybody please tell me the difference between ...

23. Printing from a jsp page- java attributes...?

I've heard that there is a way to set the printing attributes with java to make a printer print a document in landscape... does that carry over to jsp and web pages? Does anyone know how I might set the default for printing something from my web page to 'landscape'? So if they just push the IE print button it'll automatically ...

24. extends attribute in JSP

25. Getting an attribute from a JSP

27. Sorting LDAP attributes

28. pass attributes

30. Need assistance with attributes in JSP

Since it does work when the variable's scope is at the ServletContext, but doesn't work when the variable's scope is at the request level then there's likely a problem with how the request is being forwarded. If you'd like to keep the variable at the request level (which should work and you should do), please provide some details on how you're ...

31. Passing objects with attributes

You are correct, you can not do this. There are two problems with the approach you have tried. The request context is local to a single web application on a single server. The request context only exists for the duration of a single request (ie, while a page is being built to reply to one URL from a browser, and any ...

32. attribute is lost

33. Trouble with attributes and redirect

34. c:if won't accept any attributes!

35. Using c:set with target attribute

37. Onchange Attribute in TLD

You're right, I was using ONCHANGE instead of onchange. HOwever i'm getting a new error now: org.apache.jasper.JasperException: /index.jsp(2,0) According to the TLD or the tag file, attribute onchange is mandatory for tag redirect So do i just copy the attribute specification ie. onchange true true to the index.jsp file? If so, where? The contents of my index.jsp file are ...

38. Attribute onchange

39. jsp pageEncoding attribute

40. Pop up from an html:link with an action attribute

Hello everyone. Although I think this is a relatively easy thing to do, I can't quite figure it out. I have the jsp code below which works fine: Now what I'm trying to do is have a little popup window appear when that link is clicked on. I do have a js function already written to ...

41. attributes and paramters

Hi, What is the difference between the request attribute and request parameter? I have found that a request attribute is being created for every request parameter i.e when i have form that has parameters of name id and password I am able to access the values using request.getAttribute("Id"),request.getAttribute("Password"),request.getParameter("id"),request.getParameter("password") in tomcat.Why is it needed? Thanks in advance William

42. sevlet attributes

43. what is flush attribute in jsp

44. Question about the plugin archive attribute

Is there any way to get the archive attribute to take a variable? What I want to do is to be able to change the value in an XML file and have that read at run time. For example, what I have now looks like this: What I would like to do is to ...

45. Accessing Attribute Values

46. XML tagfile with dynamic attributes

I know that XSLT includes an element where you can predefine a set of attributes (e.g. 'name' and 'value'), plus a 'use-attribute-sets' attribute on the element where you can add those attributes to a particular element. Now if you could just work an XSL transformation step into your processing at the right time, this might be the basis of ...

47. Mandatory Attributes in Directives

50. get/set attribute

Hi, I have a Action class and it forwards to a jsp. I set a Object in request scopt and obtain it in jsp and again set it to request scope. Now in jsp i have a button, when clicked this goes to another Action Class. I am not able to get the object from request. it is always null. -Rang ...

51. [jsp:attribute] and RTExpr

54. Using attributes

Sometimes I just need another pair of eyes to look at my code. I thought I had done something like your example, but when I went back to take that exclamation point out, I noticed I was declaring videoList to be of type VideoList, and trying to cast the attribute to (VideoList). I must have looked at that code for hours ...

55. Set an attribute when a link is pressed

56. action attribute in JSP

Hello Anand, You have asked the difference between these two statements:

1st statement specifies the complete path of LoginHandler. CrdServlet is also the name of the project, it seems from web.xml file. While 2nd statement assumes that LoginHandler is in the current working directory. If you write LoginHandler in some other directory say, ...

57. class attribute invalid

Hi all, I'm about to go bananas. I'm trying to write a simple JSP with a bean and I keep getting this error (I'm using Tomcat 5.5.17): org.apache.jasper.JasperException: /am/defaultdata.jsp(2,0) The value for the useBean class attribute be.ictservices.aansluitingsmodule.dto.Lead is invalid. This is my bean: package be.ictservices.aansluitingsmodule.dto; import; import java.util.*; public class Lead implements Serializable { private Map data; private String id; ...

59. Dynamically changing class attribute of TD without Scriptlet

Hi Ben Souther, In my project I am using a custom calendar. I have a set of classes in CSS such as , .one_form { bla bla bla } .two_form { bla bla bla } According to some database values the any one of the class name should be assigned to TD.

Is it any possibility without using Scriptlets. ...

60. Dynamic values for HTML-element attributes

Instead of using hard coded strings for HTML-attributes I'd like to assign values dynamically. For instance I would like to keep values for tooltips in a separate properties-file and refer to these in the title-attribute of a HTML-element. I'm using JSPs, and I don't want to use javascript. If this is possible, can anyone tell me how I can do this? ...

62. Checking for none existing Attribute

64. JSP not getting application level attribute properly

I have written a servlet to get data from database and store them in Hashmap. Then Set an attribute at application level. To test i vhave written a test jsp. I am getting that attribute in another JSP. But here the getAttribute returns null some time and sometime it returns normal Hashmap. The return of this random and unable to find ...

66. jsp:setbean with param attribute

I am learning jsp and trying to run following code in jsp : <% request.setAttribute("psaaword" ,"12345"); %> and my Bean has following code : private String name="priyanka"; private String Password="12345"; public void setName(String n) { name=n; } public String getName() { return name; } public void ...

67. fmt:formatDate timeZone attribute

68. regarding attributes

69. what is the attribute in servlet ?

70. About Servlet get attribute

71. ID attribute in tr, td of table

72. Setting attributes from JSP to Servlet

73. logic in dynamic-attribute

76. jsp customtag as an attribute?

77. Adding Attributes to Servlet Link?

79. ServletRequest Attributes

80. ServletRequest Attribute serialization

81. Passing attributes from servlet to jsp

82. attribute from jsp to servlet

83. Use of flush Attribute in

86. JSP to Servlet to JSP attribute problem

87. Setting variables from tagfiles with "var-from-attribute"

I've been trying to do what I thought was simple - have a tag into which I pass a variable name so that the tag can stuff a useful value into it. I've followed the simple examples I've found (and my tag is as simple as the simplest), but even with an exact transcription of the example from the Oracle site ...

89. unable to set the value of Internal attribute using

Before explaining the problem let me just give the code I have two classes Person and Dog. The code is as follows: package model; public class Person { private String name; private Dog dog; public String getName() { return name; } public void setName(String name) { = name; } public Dog getDog() { return dog; } public void setDog(Dog dog) ...

93. attribute error

95. setting an attribute on the httprequest within a jsp

I have a servlet that looks up a user and sets an attribute on the request. Next, it's forwarded to a jsp via a requestdispatcher. In the ensuing jsp, I get the object I set in the servlet and display various attributes of that object. On this jsp, there are 2 forms and 2 corresponding buttons to process this user, depending ...

97. isErrorPage and errorPage attributes

HI, I was trying out a simple example of isErrorPage and errorPage ...follwing is the code TestJSP1.jsp <%@ page language="java" contentType="text/html; charset=UTF-8" errorPage="ErrorHandler.jsp" pageEncoding="UTF-8"%> Insert title here <%int i= 0; if (i==0) { throw new Exception(); } %> Hello World ErrorHandler.jsp <%@ page ...

100. Attribute Setting failed