scriplet « Tag « JSP-Servlet Q&A

1. What's wrong isn't equal <%= %> expression in jsp file? & can i use action tags with scriplet in same file?

<?xml version="1.0" encoding="ISO-8859-1" ?>

    <![CDATA[ <?xml version="1.0" encoding="ISO-8859-1" ?> ]]>

    <![CDATA[ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ""> ]]>

<html xmlns="">

<meta ...

2. Jsp scriplet with HTML tag in it in a loop

In my jsp code, all the div tags are inside nested-for loop ('for' writtem in scriptlet). Something like,

<% for(i=0;i<5;i++){ %>
    <% for(j=0;j<5;j++){ %>

3. Nesting jsp scriplet inside jsp: tags

4. Embedding a Tag in a scriplet

Here's the scriptlet in question: <% int k = 0; while (k < customFieldNames.size()) { int z = k+1; String placeHolder = (String)request.getAttribute("USER_DEFINED" + z); out.println("

"); out.println(customFieldNames.get(k) + ": "); out.println(""); if (placeHolder != null) { out.println(""); } else { out.println("

5. Tags Not Scriplet

7. How to write custom Tags for the existing java scriplet in JSP page?

Hi, I have already an JSP page being existed and am in the process of re-writing the page with custom tags. I was privided a Java helper class and a JSP to re-write that. As, I am completely new to custom tags, I am scraping this message. If an one can help me out with atleast one example then it would ...