setAttribute « Request « JSP-Servlet Q&A





1. Using request.setAttribute in a JSP page    stackoverflow.com

Is it possible to use request.setAttribute on a JSP page and then on HTML Submit get the same request attribute in the Servlet?

2. Hi, what's wrong about request.getSession().setAttribute()    stackoverflow.com

I use to pass data between *.java and *.jsp, since this is a MVC framework, it will go by the *.java first. so i used request.getSession().setAttribute("test", "01010101010") to save the value, ...

3. Using $request.session.setAttribute to store a dropdown's setting    stackoverflow.com

I'm trying to store a drop-down's setting that's controlling how many items to display in a roster. How do I go about doing this? The dropdown is using onChange to sort ...

4. Getting null values while using request.setAttribute and get    stackoverflow.com

I need to pass a variable from Admin.java file to index.jsp. I get the value when I print it in Admin.java. I need to pass that value to another variable which ...

5. request.get/setAttribute() vs this.getServletContext().get/setAttribute()    stackoverflow.com

what's the difference between get/setAttribute() when you call them from request and from getServletContext(). I noticed that you need

RequestDispatcher rd = request.getRequestDispatcher("/view.jsp");
rd.forward(request, response); 
for the request to work, but you ...

6. do request.setAttribute in jsp page and request.getAttribute in java code    stackoverflow.com

Is this possible that i do request.setAttribute in jsp code and retrive the value using request.getAttribute in java struts code.

7. Servlet not forwarding to jsp when session.setAttribute or request.setAttribute is called    stackoverflow.com

My Servlet is not forwarding to my JSP, when I use session.setAttribute(-) or request.setAttribute(-). Servlet is fowarding only if session/request.setAttribute(-) code is commented but I need to send data from Servlet to ...

8. request.setAttribute    coderanch.com





10. i do not understand servlet request.setAttribute ~    coderanch.com

i'm newbie in struts, i do have difficulty of understanding on how request.setAttribute work , what is the value i get after request.setAttribute? SignupAction1.java import javax.servlet.http.*; import org.apache.struts.action.*; public class SignupAction1 extends Action { public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { ContactFormBean userBean = (ContactFormBean)form; String firstName = userBean.getFirstName(); String lastName = userBean.getLastName(); String email ...

11. request.setAttribute() in servlet    coderanch.com

13. request.setAttribute() and request.getAttribute()    coderanch.com

Following is the code i have written in A.jsp page <% String select[] = request.getParameterValues("id"); if (select != null && select.length != 0) { out.println("You have selected: "); for (int i = 0; i < select.length; i++) { out.println(select[i]); } } %> <% request.setAttribute("idvalues",select); Following is the code i have written in B.jsp page <% String headname[] = new String[100]; headname=(String[]) ...

15. problem with request.setAttribute() when accessing it in JSP    forums.oracle.com

Hi, i have code like this ArrayList allFields; public ArrayList getFields() { // it returns some ArrayList with values like return allFields // allFields is ArrayList instance } then im accessing the allFields using ArrayList sampleArray= getFields(); request.setAttribute("name",sampleArray); allFields.clear(); now, when i'm accesing it in JSP using request.getAttribute("name") it returns null, can u help me plz thanx in advance

16. request.setAttribute() - servlet, request.getAttribute() - jsp    forums.oracle.com

Hi all, I know it's been writter all over but I cannot find a concrete explanation of what is happening. Here is the thing: I have a

from which I call a servlet. In servelet I do this: request.setAttribute(result, "Hello Java"); than I redirect to another jsp page, let's call it index.jsp index.jsp has: request.getAttribute( result); //i think this is ...





17. request.setAttribute() and jsp    forums.oracle.com