Re: Custom Tag: embedding tag inside tag# Java - 爪哇娇娃
m*c
1 楼
What don't you use nested tag to solve the problem:
You need to implement BodyTagSupport (cannot remember if it is correct name) for tag2. tag2 can "communicate" tag1. attribute
r*u
2 楼
Yeah, I thought about nested tag too but it doesn't really fit my case. What I have really is something like where "string" needs to be retrieved from a int'lized resource bundle. I could've put the bundle information in tag1 but hoping there's an easier way of doing this. Currently I am looking at JSTL and EL stuff - that should provide a good solution... Thanks for your suggestion.
【在 m**c 的大作中提到】 : : What don't you use nested tag to solve the problem: : : : : You need to implement BodyTagSupport (cannot remember if it is correct name) : for tag2. tag2 can "communicate" tag1. : attribute
n*k
3 楼
I Really doubt you can do it with JSTL. I personal do not like this design, using javabean for that resource second tag makes life lots of easy. name)
【在 r*u 的大作中提到】 : Yeah, I thought about nested tag too but it doesn't really fit my case. What I : have really is something like : : where "string" needs to be retrieved from a int'lized resource bundle. I : could've put the bundle information in tag1 but hoping there's an easier way : of doing this. : Currently I am looking at JSTL and EL stuff - that should provide a good : solution... : Thanks for your suggestion.
r*u
4 楼
I can retreive that string from a JSTL tag (fmt:message), now the question is how to set the result of that tag to a bean object. Or am I drilling into a dead end here? :(
What way
【在 n*****k 的大作中提到】 : : I : Really doubt you can do it with JSTL. I personal do not like this design, : using javabean for that resource second tag makes life lots of easy. : name)
n*k
5 楼
is First all, I am not an expert in this field, so do not take my words so seriously. What I am trying to say is you can transfer the resourse tag into a javabean, so than you can use this javabean within any other tags. I just know JSTL, but I am pretty sure there are lots of other tag libraries out there, so you may find something suit you well. Otherwise, what you have to do is redesign the tag, so that it can be used within other tag.
【在 r*u 的大作中提到】 : I can retreive that string from a JSTL tag (fmt:message), now the question is : how to set the result of that tag to a bean object. : Or am I drilling into a dead end here? :( : : What : way
r*u
6 楼
Yeah, the JavaBean approach will be my backup plan. Any good places you know for looking up other tag libs? Thanks a lot.
javabean,
【在 n*****k 的大作中提到】 : : is : First all, I am not an expert in this field, so do not take my words so : seriously. : What I am trying to say is you can transfer the resourse tag into a javabean, : so than you can use this javabean within any other tags. : I just know JSTL, but I am pretty sure there are lots of other tag libraries : out there, so you may find something suit you well. : Otherwise, what you have to do is redesign the tag, so that it can be used : within other tag.
【在 r*u 的大作中提到】 : Yeah, the JavaBean approach will be my backup plan. Any good places you know : for looking up other tag libs? Thanks a lot. : : javabean,