- This topic has 2 replies, 2 voices, and was last updated 20 years, 1 month ago by Riyad Kalla.
Viewing 3 posts - 1 through 3 (of 3 total)
-
AuthorPosts
-
glurpsMemberi get a nullpointer for ‘pageContext’ in:
package taglibs; import java.io.*; import javax.servlet.jsp.*; import javax.servlet.jsp.tagext.*; public class OldSchool extends TagSupport { private JspWriter out = pageContext.getOut(); public int doStartTag() throws JspException { try { out.println("hello world"); } catch (IOException e){ throw new JspException(e); } return SKIP_BODY; } }
i had no problem doing so in the old syntax but xml-style seams not to work.
i am not sure if line 4 is correct in the .tdl:
<?xml version="1.0" encoding="UTF-8"?> <taglib xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd" version="2.0"> <description>oldschool test</description> <tlib-version>1.0</tlib-version> <short-name>oldschooltest</short-name> <tag> <description>test oldschool tags</description> <name>helloworld</name> <tag-class>taglibs.OldSchool</tag-class> <body-content>empty</body-content> </tag> </taglib>
for completness the jspx where the tag gets included:
<?xml version="1.0" encoding="UTF-8"?> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:oldschool="urn:jsptld:/WEB-INF/tlds/oldschool.tld" xml:lang="en"> <jsp:directive.include file="deploytype.jspx" /> <head></head> <body> <oldschool:helloworld /> </body> </html>
glurpsMembersidenote: when trying to preview my post i am taken to http://myeclipseide.com/index.php without any arguments.
Riyad KallaMemberMoving to Random Thoughts, this is a Java question.
-
AuthorPosts
Viewing 3 posts - 1 through 3 (of 3 total)