EL « API « JSP-Servlet Q&A





1. Call HashMap from jsp EL?    stackoverflow.com

Here is my Entity Class

 public enum UnitType {

    HOSPITAL, HEALTHCENTER
}
public static LinkedHashMap<UnitType, String> unitType = new LinkedHashMap<UnitType, String>() {
    {
     ...

2. why there is a need of pageContext in jsp    stackoverflow.com

when we can access all the implicit variables in jsp , why do we have pageContext. solution : if we use el expressions or jstl , to access or set the attributes ...

3. How can I access with Experssion language (JSP) a HashMap    stackoverflow.com

:) I'm having some problems here on manipulating data in EL / JSP. I have two variables in my Action (I'm using struts2) they are:

private List<Appointment> appointment;
private Map<Integer, String> doctors;
Appointment has the attribute ...

4. Access hashmap value by variable in JSP    stackoverflow.com

I have a hashmap, which is put to the request:

HashMap<Integer, String> myMap = ...
request.setAttribute("myMap", myMap);
In JSP I have a foreach loop
<c:forEach items="${list}" var="item" varStatus="status">
   <c:out value="${item.description}"/>
   <c:out ...

5. Hashmap Error: javax.el.PropertyNotFoundException    stackoverflow.com

I created a hashmap in my SERVLET as follows:

 int productId = Integer.parseInt(request.getParameter("productId"));

 HashMap cartList = new HashMap();
 Cart item = new Cart(productId, productName, price, quantity);
 cartList.put(productId, item);
But I have get ...

6. How to evaluate a scriptlet variable in EL?    stackoverflow.com

I was wondering if there was anyway of using JSP in <c:if> statement. E.g.

<c:if test="${ param.variable1 == 'Add' <% JSP variable clause %>}">
So I want my JSP variable to checked against as ...

7. ArrayList of ArrayLists- accessing values with EL    stackoverflow.com

I have an Arraylist of Arraylist< String>'s and I am trying to access a string value. Say I wanted to access the third String in the second ArrayList in my jsp ...

8. equivalent of EL in jsp scriptlet    stackoverflow.com

What would be equivalent of the below code in simple scriptlet code:

<select name="dropdown">     
     <option value="one" ${param.dropdown == 'one' ? 'selected' : ''}>One</option> ...

9. with Action OK, but EL get Error    coderanch.com

Hi everyone I made a little MVC, when I use the getProperty it`s ok. but if I put the line with EL I get a error code: <%@ page import="EL.*" %> The List of Parameters and
***** get it with EL ${request.modelito.nombre} ***** if ...





10. Using EL with Array    coderanch.com

11. scriptlet to el/action    coderanch.com

12. EL param and reguest.getParameter    coderanch.com

Hi, The problem was due to a syntax error. Though I was working on this problem for a long time, i couldn't notice it. Then I read the already discussed topic "EL param and page scope vars posted on November 22, 2005" a second time, and realised that I should use request.getParameter("paramName") and it worked. The quote was missing in my ...

14. Using EL to retrive data from Arraylist    coderanch.com

Yes, is the appropriate mans to loop through the List. Look carefully at the attributes of and you will see that the var attribute allows you to specify the name of the scoped variable that will be set inside the loop to reference each list element. So you never need to worry about dereferencing the list; will do ...

15. Accessing array using EL    coderanch.com

16. setting attribute using EL    coderanch.com





17. pass value to a java method in EL(using TLD)    coderanch.com

Hi, I'm getting the value from request, by passing this value I want to call a java method(getSquere()). In the jsp where I am calling the java method using prefix and want to pass the value which comes with request to method. I have used EL and <%= %> to get the values and pass an arguemnt but none of them ...

18. pageContext in EL    coderanch.com

i think the pageContext can get any implicited object of jsp, I try ${pageContext.request.requestURL} it works well. now, i store a bean "address" with property "street" in request scope, and when i try ${pageContext.request.attribute["street"]} it throws exception? so what happened? I know ${requestScope.address.street} , ${address.street} and ${address["street"]} all can get the property value. But Can i use the pageContext to get ...

19. passing EL variable to scriptlet    coderanch.com

20. using EL to get at derrived attributes    coderanch.com

21. Return a List or Array from an EL function results in exception    coderanch.com

Hi guys!! Well, the title is not exactly true, let me explain what is happening. I have an EL function called toArray(String, pageContext) that function (java method) splits the String into objects and add them to a List, and the function returns that List. The interesting thing is that I use that List in other places of my jsp, concretly in ...

24. Scriptlet to EL    coderanch.com

25. Unable to access array values using EL    coderanch.com

Updated my Thread..to add code tag..... hi, This is my first post. I have a class that returns an Arraylist of string arrays.. public class TaskRetriever { String username; String task_type; Connection con; ArrayList Rows; public ArrayList getRows() { try { if(!this.con.isClosed()) { String total_tasks="select * from user_task where "+task_type+"=\""+username+"\""; // String com_tasks="select * from user_task where username=\""+username+"\" and status=\"1\""; Statement ...

26. Unable to access a arrayList set in pagecontext through EL    coderanch.com

Hey everyone, I am a EL and java newbie and had this frustrating error. Thought would post it here hoping somebody might have a look at this. Context: I am setting an ArrayList in the page context in the back-end like this. This is tag which I declared in a tld. . This contains AgentMessage Objects which contain some information such ...

28. EL: using variable within an array-variable    coderanch.com

Hi folks, I'm quite new to the whole jstl things, so please don't be too harsh on me, when I'm maybe posting something self-evident OR something nonsensical. My problem is as follows: I've got a forEach loop which looks like this: , this ...

29. using EL to get the keySet of a HashMap    coderanch.com