The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.

How to get the JSP line postition in Tag class?

Hi,

is it possible to determine the exact line-position in JSP files inside a Tag (or TagSupport Class)?
We need this to generate a unique, but don't variable ID, it must the same by every request. (Depending on the actual position in the JSP)

We've thought about the possibility to generate a ID over the StackTrace, but we aren't shure if this is a save method, cause every Webcontainer may translate the JSPs in a different way.
(It must work on every web- or j2ee-container)
IDs on different containers may be different, but in the same instance they must be exactly the same. (For every position, of course)

When the IfTag is called on "<c:if test="${empty activeForm.testMessages}">" i need in the tag class a information like "test:jsp 102" where 102 is the actual line in the jsp.
Particular i will use this at rendering time in the doStartTag() and doEndTag() Method in the Tag class.