how to effectively use existing tags within json tags?

52 views
Skip to first unread message

freebeme

unread,
Feb 5, 2009, 6:59:59 AM2/5/09
to json-taglib
Hello,

I have jsp tags for doing certain things. I created them years ago and
sometimes use them like this e.g.:

<mytag:doSomething value="<%=v%>" />

I am now modifying my jsp's to output json.

I guess this is a a general jsp question but how can I now achieve the
following sort of thing or is it not possible or am I having a stupid
moment:

<json:object>
<jspn:property name="value" property="<mytag:doSomething value="<%=v
%>" />" />
</json:object>

You see I want to be be able to json escape whatever the doSomething
tag returns.

Alternatively, Im happy to use the java toolkit for JSON, something
like

<%
JSONObject obj = new JSONObject()
obj.put("value","<mytag:doSomething value="v"/>");
%>

freebeme

unread,
Feb 10, 2009, 6:12:55 PM2/10/09
to json-taglib
I sorted this out. The question related to old tags which basically
formatted the output e.g. like format date but more complicated. I
wanted to be able to re-use the processing in the tags without having
to do much work. Anyhow I worked out a way of doing it.
Reply all
Reply to author
Forward
0 new messages