Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

how to write jsp custom tag that can have all kind of jsp elements
i want to write jsp custom tag that prints string "begin", then invokes
all jsp instructions from it's body (instructions == other tags and
scriplets), and then prints string "end". i've tried to write it by
extending SimpleTagSupport class, and coding sth like that:

public void doStartTag() throws JspException {
JspWriter out = getJspContext().getOut();

try{
out.println("begin");
getJspBody().invoke(null);
out.println("end");
} catch (IOException e) {
throw new JspTagException("RuleFileTd tag exception :" +
e.getMessage());
}
}

the class with above method compiles without errors. this is a
body-content tag of my custom tag definition in tld file i use:

<body-content>JSP</body-content>

but during execution of my jsp page tomcat gives me error saying that
body-content cannot be set to JSP while using SimpleTagSupport.

what to do now? maybe i should extend other class to write my tag? how
to implement a tag that allows other tags and scriplets in his body?

Report this thread to moderator Post Follow-up to this message
Old Post
Lukasz Indyk
09-22-04 02:10 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Java Help archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:14 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.