Angel Belda wrote:
>
> Hello,
>
> can anyone tell me in which order the processing of the parameters is
> effected when I use:
>
> <jsp:useBean id="XX" scope="request" class="xx" />
> <jsp:setProperty name="XX" property="*" />
>
> is there a possibility to influence the sequence?
I'm afraid not. You have to write your bean so that the order doesn't
matter. Typically, the property setter methods just save the value as
an instance variable. The you use another method to do whatever it is
you want to do with the property values. If what you do results in
text that you want to add to the JSP page, you can actually define
this method as a bean getter method and use <jsp:getProperty> to
invoke it and add the result to the page:
package com.foo;
public class MyAddBean {
private int firstNumber;
private int secondNumber;
public void setFirstNumber(int numb) {
firstNumber = numb;
}
public void setSecondNumber(int numb) {
secondNumber = numb;
}
public int getSum() {
return firstNumber + secondNumber;
}
}
<jsp:useBean id="calc" class="com.foo.MyAddBean"/>
<jsp:setProperty id="calc" property="*" />
<jsp:getProperty id="calc" property="sum" />
Or you can call the "do something" method using a scriptlet or an
expression:
<%= calc.getSum(); %>
Hans
--
Hans Bergsten [EMAIL PROTECTED]
Gefion Software http://www.gefionsoftware.com
Author of JavaServer Pages (O'Reilly), http://TheJSPBook.com
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets