JSTL c:set exception

R

Rick DeBay

JSTL doesn't see "name" as a valid property for c:set, but c:eek:ut has no problem
printing it. Any ideas? Tomcat 5.0.16 w/ JSTL 1.1

exception:
javax.servlet.ServletException: Invalid property in <set>: "name"

JSTL:
<c:eek:ut value="${onlineCategory.name}"/>
<c:set target="onlineCategory" property="name" value=""/>

class:
//hack to display fixed categories until back end is working
import java.util.*;
public class Category
{
public int ID;
public String name;
public List subCategories = new ArrayList();

public Category(int ID, String name)
{
this.ID = ID;
this.name = name;
}

public void addSubCategory(Category c)
{
subCategories.add(c);
}

public int getID() {return ID;}
public String getName() {return name;}
public List getSubCategories() {return subCategories;}
public void setID(int id) {ID = id;}
public void setName(String n) {name = n;}
}
 
S

Scott Yanoff

Rick said:
JSTL doesn't see "name" as a valid property for c:set, but c:eek:ut has no problem
printing it. Any ideas? Tomcat 5.0.16 w/ JSTL 1.1

exception:
javax.servlet.ServletException: Invalid property in <set>: "name"

JSTL:
<c:eek:ut value="${onlineCategory.name}"/>
<c:set target="onlineCategory" property="name" value=""/>

Yeah, it may be a reserved word and therefore it doesn't like it.
What if you picked something different, such as "categoryName"?

Good luck,
-Scott
 
R

Rick DeBay

Yeah, it may be a reserved word and therefore it doesn't like it.
What if you picked something different, such as "categoryName"?

Good luck,
-Scott

Thanks, I'll give that a try Monday.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top