Migration Solutions for ColdFusion Applications to ASP.NET
      
New Atlanta Product Forums Profile | Search | Login | RSS
New Topic Reply   Previous Page  Page: 1   Next Page

Thread: Cannot access jspContext implicit object inside custom tag file
Created on: 04/11/11 11:53 AM Replies: 2
cpdjh02


Joined: 04/08/11
Posts: 17
Cannot access jspContext implicit object inside custom tag file
04/11/11 11:53 AM

I am unable to access the jspContext implicit objects from within a .tag files because the jspContext object in the compiled java file has private access:

Here is a sample file (testTag.tag) that demonstrates the issue:
<%jspContext.setAttribute("Test","test");%>

This is a test tag.


Here is a JPS file that calls this custom tag:
[code]
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%@ taglib tagdir="/WEB-INF/tags" prefix="testTags" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Test for tagdir tags.</title>   
</head>
<body>
This is my JSP page.
   <testTags:testTag/>
<br>
</body>
</html>
[\code]

Here is the error I’m getting:
_testTag_xtag.java:54: jspContext has private access in javax.servlet.jsp.tagext.SimpleTagSupport

jspContext.setAttribute("Test","test");


I'm pretty sure this is a bug, since I beleive that all scripting languages are required to provide access to the jspContext object inside tag files.

Any Ideas
Thanks
David
Link | Top | Bottom
paulbonfanti


Joined: 10/04/07
Posts: 451
RE: Cannot access jspContext implicit object inside custom tag file
04/11/11 12:47 PM

Looking at the JavaDocs for SimpleTagSupport, you should be able to get to the JSP context by calling getJspContext().
Paul Bonfanti, New Atlanta
Link | Top | Bottom
cpdjh02


Joined: 04/08/11
Posts: 17
RE: Cannot access jspContext implicit object inside custom tag file
04/11/11 2:19 PM

Thanks Paul

That work around worked. I think it might be a good idea for you to look into changing this maybe because according to the spec the jspContext object is supposed to be made available. It would make things easier for developers (like me) who are trying to migrate their code onto ServletExec from other platforms like Tomcat.

Thanks
David
Link | Top | Bottom

New Post
Please login to post a response.


company media information terms of use privacy policy contact us
This page was dynamically built on the BlueDragon CFML Engine