jsp:useBean with possibly omitted beans.

D

Daniel Pitts

Hello everyone.
Some background: I'm using Spring 1.2.8 and Tiles. This gives me the
ability to create a model in Java code, and "pass" that model to the
JSP in request scope.

I'd like to use <jsp:useBean id="someBean" scope="request"
type="my.bean.SomeBeanType" />. This gives my tools (IntelliJ Idea in
this case) the ability to verify, validate, and suggest. This works
in most cases.

Where this does not work is in the optional bean case. If I only put
someBean into my model under certain circumstances, <jsp:useBean> will
try to instantiate a SomeBeanType and put it in the request scope.
I'd like to actually create a null reference instead, or leave it
undefined. Is there any way to do this without wrapping all the code
with an <c:if> element?
 

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,755
Messages
2,569,536
Members
45,019
Latest member
RoxannaSta

Latest Threads

Top