You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-user@tomcat.apache.org by Roman Kapshevich <ro...@ucapital.ru> on 2002/05/23 09:09:29 UTC

Usage of c:set for setting JavaBeans properties

Hello!

I'm tryed to set property of my bean by <c:set> tag. But the exception was
thrown. Am I doing something wrong
or is it a bug in tag? I'm runing JRun 4.0 and Beta 2 JSTL.

<c:set target="${cart}" property="currentProduct" value="${i.key}"/>

Value is not null and it's looks like number. it's output succesfully.

Beans method is simple:

 public void setCurrentProduct(int currentProduct) {
    this.currentProduct = currentProduct;
  }

java.lang.IllegalArgumentException
 at sun.reflect.GeneratedMethodAccessor574.invoke(Unknown Source)
 at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
 at java.lang.reflect.Method.invoke(Method.java:324)
 at
org.apache.taglibs.standard.tag.common.core.SetSupport.doEndTag(SetSupport.j
ava:170)
 at jrun__order__cart2ejspf._jspService(jrun__order__cart2ejspf.java:283)
 at jrun.jsp.runtime.HttpJSPServlet.service(HttpJSPServlet.java:43)
 at jrun.jsp.JSPServlet.service(JSPServlet.java:106)
 at jrun.servlet.FilterChain.doFilter(FilterChain.java:86)
 at jrun.servlet.filters.TimingFilter.doFilter(TimingFilter.java:65)
 at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
 at jrun.servlet.FilterChain.service(FilterChain.java:101)
 at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)
 at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
 at
jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:241)
 at
jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:527)
 at jrun.servlet.http.WebService.invokeRunnable(WebService.java:172)
 at
jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:
348)
 at
jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:451
)
 at
jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:29
4)
 at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)


Best regards,
Roman Kapshevich
ICQ 2032093


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


parameterize the locale through a beans' property

Posted by kristian meier <km...@jentro.com>.
Hello,

I wanted to parameterize the locale for each request through a property 
of a bean, but the property is not propagated to the setLocale tag, so
the resources bundle is not found.

<i18n:setLocale value="<c:out value='${user.lang}'/>" scope="request"/>

<i18n:setBundle basename="com.jentro.Resources" var="locale" 
scope="request"/>

a workaround like the following does work, but it is sort of ugly

<c:choose>
  <c:when test="${users.user.lang == 'de'}">
    <i18n:setLocale value="de" scope="request"/>
  </c:when>
  <c:otherwise>
    <i18n:setLocale value="en" scope="request"/>
  </c:otherwise>
</c:choose>

do I have general misunderstanding of when and how to nest tags ?

best wishes
Kristian


-- 
-------------------------------------------------------------
Jentro AG
Kristian Meier, Software Development
-------------------------------------------------------------
Peter-Henlein-Strasse 28, 85540 Haar/Munich, Germany
Tel. +49 89 462 385 0 mailto:Kristian.Meier@jentro.com
Fax +49 89 462 385 29 http://www.jentro.com
-------------------------------------------------------------


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>