Link to home
Start Free TrialLog in
Avatar of Celedor
Celedor

asked on

Tags to generate JSP?

Let's say I have the following two tags:

<test:first />
<test:second />

Outputs:

Hello
World!

Is it possible to create a third custom tag that combines the two?

<test:combination />

Outputs:
Hello
World!

It would be nice to be able to do this without resorting to calling the doXXXTag/etc. methods of the respective tag handlers.  Maybe generate the JSP code in the body and somehow ask the container to evaluate it?
Avatar of bloodredsun
bloodredsun
Flag of Australia image

>>Is it possible to create a third custom tag that combines the two?
Yes

>>It would be nice to be able to do this without resorting to calling the doXXXTag/etc. methods of the respective tag handlers.  Maybe generate the JSP code in the body and somehow ask the container to evaluate it?

You can either cut and paste the source for the respective tags or do as you say and call the methods. A

I don't know why you would want to do this as the two tags give you more flexibility and it makes very little difference to have 2 tags rather than 1.

What are you actually trying to do, as I assume that this is a hypothtical example.
Avatar of Celedor
Celedor

ASKER

Let's say its a whole bunch of tags, and you don't want to resort to includes.
ASKER CERTIFIED SOLUTION
Avatar of bloodredsun
bloodredsun
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Agreed