el

How to get eclipse JSP Expression Language validation to accept JSP 2.2 EL constructs?

£可爱£侵袭症+ 提交于 2020-01-03 18:51:28
问题 I have a page with the following JSP tag: <c:set var="task" value="${report.taskMap['bin:'.concat(bin.id)]}" /> This works fine, but Eclipse complains about it being a syntax error, presumably because the '.concat(bin.id)' part is a JSP 2.2 extension not supported in older versions of JSP. Is there any way of telling Eclipse to accept this syntax? Or, alternatively, is there a way of telling Eclipse not to consider JSP validation errors as errors, and mark them as warnings instead? I'd rather

JSP2 expression in Struts2 form input

╄→гoц情女王★ 提交于 2020-01-03 06:02:22
问题 I’ve started playing around with JSPs and Struts2. I’ve read through a bunch of tutorials and specs, and now I’m trying my hand at a very simple application using Struts2, JSP2 EL, and creating a custom taglib. What I am trying to do is create a simple reusable login control. I’ve created a JSP that will check the session to see if a user is logged in, and if not display a login page. The issue I am having is I can’t seem put the retPage attribute in login.tag as a value in a hidden input

jsp:useBean call a specific method in a class

六眼飞鱼酱① 提交于 2020-01-03 00:02:57
问题 How can I call a specific method in a class using this tag? <jsp:useBean id="user" scope="??" class="com.example.User" type="com.example.User" /> 回答1: Assuming your bean User has a method called getName() <jsp:useBean id="user" scope="request" class="com.example.User" /> // ... <h1>Hello <jsp:getProperty name="user" property="name" /></h1> The scope could be something else than request : depends on what you want (session, page, etc) EDIT: your second question was about calling a business

jsp:useBean call a specific method in a class

谁说胖子不能爱 提交于 2020-01-03 00:02:53
问题 How can I call a specific method in a class using this tag? <jsp:useBean id="user" scope="??" class="com.example.User" type="com.example.User" /> 回答1: Assuming your bean User has a method called getName() <jsp:useBean id="user" scope="request" class="com.example.User" /> // ... <h1>Hello <jsp:getProperty name="user" property="name" /></h1> The scope could be something else than request : depends on what you want (session, page, etc) EDIT: your second question was about calling a business

What does the el #{facesContext.externalContext.requestContextPath} mean?

Deadly 提交于 2020-01-02 12:01:29
问题 I am trying to use Exadel Fiji for rendering Pie graphs. Can someone tell me what does the el #{facesContext.externalContext.requestContextPath} mean ? 回答1: It returns you path to your project in webapps directory. For instance, if your project name is myProj,that it will return /myProj As I see,it's needed to avoid hardcoding of your web-project name. For instance, you .war file(archive,that contains your project) may be named different ways and you shouldn't know what exactly name it will

What does the el #{facesContext.externalContext.requestContextPath} mean?

梦想与她 提交于 2020-01-02 12:00:35
问题 I am trying to use Exadel Fiji for rendering Pie graphs. Can someone tell me what does the el #{facesContext.externalContext.requestContextPath} mean ? 回答1: It returns you path to your project in webapps directory. For instance, if your project name is myProj,that it will return /myProj As I see,it's needed to avoid hardcoding of your web-project name. For instance, you .war file(archive,that contains your project) may be named different ways and you shouldn't know what exactly name it will

How to get id of current component in EL

空扰寡人 提交于 2020-01-02 08:16:10
问题 I'm working with JSF and PrimeFaces, but I need to get the value of the id of a component. Because I'm building dinamycally panels with diferent id, to show a the panel I need to compare if is the current panel, then show it. For example if I've the next panel <p:outputPanel id="#{bean.getID}" autoUpdate="true" renderer=#{@this.id == bean.currentPanel} > </p:outputPanel> And Bean public class Bean(){ private int numberPanels =0; private int currentPanel = 0; public int getID(){ //...a process

Access raw expression of ValueExpression attribute to taglib component

泪湿孤枕 提交于 2020-01-02 06:56:11
问题 Can I access the expression string of a ValueExpression passed as attribute value to my taglib component? My goal is to programmatically derive missing attribute values from it. In this case I'm trying to avoid having to repeat an attribute as a literal. now: <a:columnText title="name" value="#{entity.name}" sortBy="entity.name" /> desired: <a:columnText title="name" value="#{entity.name}" /> -taglib.xml <tag> <tag-name>columnText</tag-name> <source>column-text.xhtml</source> <attribute>

How to write if else condition using ternary operator in jstl

自作多情 提交于 2020-01-02 05:05:32
问题 Hi guys i want to write a if else condition using ternary in JSTL. i did it using jsp. My code is using jsp : <%= relAttributeValue != "false" && !relAttributeValue.equals("false") ? "rel=\"nofollow\"" : "" %> how can i achieve it using jstl 回答1: You mean Expression Language, EL in short, since that's the component that allows you use ${something} expressions, while JSTL is a tag library which gives you tag components like <c:set> . In EL, you can do it like this: <c:set var="ternaryResult"

JSTL message: Don't know how to iterate over supplied “items” with forEach

对着背影说爱祢 提交于 2020-01-02 02:18:09
问题 I am passing a List to <c:forEach> , yet I get the error stating that it doesn't know how to iterate over it. @RequestMapping("/viewall") public String viewAll(Model model) { // productService.findAllProducts() returns List<Product> model.addAttribute("everything", productService.findAllProducts()); // Also tried using iterator, but I get same error //model.addAtrribute("everything", productService.findAllProducts().iterator()); .... } The jsp page: <c:forEach items="${everything}" var="prod"