Results 1 to 6 of 6

Thread: JSP Tags Scripting Variables

  1. #1
    Join Date
    Nov 2009
    Posts
    862

    JSP Tags Scripting Variables

    Hello, I am learning Java Programming Language. And currently I was started learning JSP. While learning it, I want to know the details about the Scripting Variables in JSP. I have tried to find out details about it, but I am not able to get the solution for it. But, If you are having details about it, then please provide me details about it, it will be helpful to me.

  2. #2
    Join Date
    May 2008
    Posts
    2,012

    Re: JSP Tags Scripting Variables

    Hi, If you want to know the details of the scripting variables then it is simply a variable which is declared in any type of scripting language. That means if you declare variable from the JSP script then that variables are called as JSP scripting variable. So, the JSP tags Scripting variables are the variables are the page level variables declared by jsp tags. If you consider the variable below then you will come to know about the Jsp tag scripting variables:
    Code:
    <star:secondtag>
    	<p align="center">Date value retrieved from JSP Tag : <%= time %></p>
    </star:secondtag>

  3. #3
    Join Date
    Apr 2008
    Posts
    2,005

    Re: JSP Tags Scripting Variables

    Hello, I have got the code below for sending JSP tag. I think you will able to get more details from it about the JSP tag:
    Code:
    import java.util.*;
    import javax.servlet.jsp.*;
    import javax.servlet.jsp.tagext.*;
    
    public final class Testing implements Tag {
    	private PageContext pagecontext = null;	
    	public void setPageContext(PageContext p) {
    		pagecontext = p;
    	}
    	public void setParent(Tag t) {}
    	public Tag getParent() { return null; }
    	public int doStartTag() throws JspException {
    		Calendar calender = Calendar.getInstance();
    		pagecontext.setAttribute("time", calender.getTime().toString());
    		return EVAL_BODY_INCLUDE;
    	}
    	public int doEndTag() throws JspException {
    		return EVAL_PAGE;
    	}
    	public void release() {
    		pagecontext = null;
    	}
    }

  4. #4
    Join Date
    Apr 2008
    Posts
    1,948

    Re: JSP Tags Scripting Variables

    Hello, JSP tags Scripting variables are simply the variables which are present in the JSP page when any type of JSP page is called. You can simply called it as a variable used in the scripting. But, in case of the JSP page it is the page level variable which is declared by the jsp page. And it is also possible that you can simply access it though the scriptlet, declaration, expressions.

  5. #5
    Join Date
    May 2008
    Posts
    2,297

    Re: JSP Tags Scripting Variables

    Hello, I have got the code below for making use of the Jsp tags Scripting variables:
    Code:
    package tags;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.jsp.tagext.*;
    public class Check extends TagExtraInfo 
    {
      public vardetail[] getVariableInfo(TagData tagdata)
     {
        return new vardetail[]
     {
          new VariableInfo("Heading", "java.lang.String", true, VariableInfo.NESTED)
        };
      }

  6. #6
    Join Date
    Oct 2005
    Posts
    2,393

    Re: JSP Tags Scripting Variables

    Hello, if you want to add the JSP tags scripting variables then for adding scripting variables in the TLD file you must need to make use of the Tag subelement as below:
    • name-given
    • name-from-attribute
    • variable-class
    • declare
    • scope

Similar Threads

  1. tool for KSH scripting
    By atul9806 in forum Software Development
    Replies: 6
    Last Post: 30-01-2011, 11:42 PM
  2. Difference between awk and sed scripting
    By Adene in forum Software Development
    Replies: 7
    Last Post: 16-04-2010, 08:44 PM
  3. Windows scripting language
    By Ashutosh_K in forum Software Development
    Replies: 3
    Last Post: 26-06-2009, 02:39 PM
  4. Want to learn Scripting Program!
    By YatinK in forum Education Career and Job Discussions
    Replies: 3
    Last Post: 10-02-2009, 06:23 PM
  5. C# AD Scripting
    By Bob in forum Active Directory
    Replies: 5
    Last Post: 31-03-2008, 09:29 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,052,715.28850 seconds with 17 queries