Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa JSP-Servlet Assigning value to anchor tag using custom tag
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Divyashree
Assigning value to anchor tag using custom tag
0 Answer(s)      a year and 4 months ago
Posted in : JSP-Servlet


hi,

I am trying to assign a value to anchor tag within a custom tag and redirecting the link to ReadPDF.jsp a show in the code . I want to display the value in the jsp , while retreiving the value and displaying its either null or empty . I think im not assiging the value properly , please help. I am stuck with this problem for a long time.

I think the problem is im assigning in custom tag .

package com.k.customtags;

import java.io.IOException;
import java.util.Iterator;
import java.util.List;

import javax.servlet.http.HttpSession;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.PageContext;
import javax.servlet.jsp.tagext.SimpleTagSupport;

import com.k.dao.impl.ReceiptgenerationDAO;
import com.k.execeptions.KBusinessException;
import com.k.execeptions.KException;
import com.k.vo.ReceiptVO;

public class PrintReceiptTag extends SimpleTagSupport{

    ReceiptgenerationDAO dao;
    List<ReceiptVO> receipt_list ;

    @Override
    public void doTag() throws JspException, IOException {
        // TODO Auto-generated method stub
        final JspWriter out = getJspContext().getOut(); // gets the output stream to
        PageContext pageContext = (PageContext)getJspContext();
        HttpSession session = pageContext.getSession();

        try {
            dao = new ReceiptgenerationDAO();
            receipt_list = dao.printReceipt();
            ReceiptVO vo ;
            Iterator<ReceiptVO> io = receipt_list.iterator();
            out.print("<table border='1'>");
            out.print("<tr>");
            out.print("<th>receipt no</th>");
            out.print("<th>Date</th>");
            out.print("<th>Details</th>");
            out.print("<th>Read File</th>");
            out.print("</tr>");

            while(io.hasNext()){
                vo = io.next();
                String receiptno = vo.getReceipt_id() + "_" + vo.getReceipt_date();
                //System.out.println("receiptno : " + receiptno);
                out.print("<tr>");
                out.print("<td>"+ vo.getReceipt_id()+"</td>");
                out.print("<td>"+ vo.getReceipt_date() + "</td>");
                out.print("<td>"+ vo.getDetails()+ "</td>");
                **out.print("<td><a href='readPDF.jsp?&RNO='"+receiptno+"'' >open</a></td>");**
                out.print("</tr>");
            }   
            out.print("</table>");


        } catch (KException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (KBusinessException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        super.doTag();

    }
}

Advertisement
View Answers

Related Tutorials/Questions & Answers:
Assigning value to anchor <a></a> tag using custom tag
Assigning value to anchor tag using custom tag  hi, I am trying to assign a value to anchor tag within a custom tag and redirecting the link... time. I think the problem is im assigning in custom tag . package
anchor tag in HTML
anchor tag in HTML  Explain anchor tag in HTML
Advertisements
Example of struts2.2.1 anchor tag.
Example of struts2.2.1 anchor tag. In this tutorial, we will introduce you to about the anchor tag of struts2.2.1. It provides a hyperlink from current page to another page. It works as anchor tag of html, but syntax is different
HTML5 Anchor Tag Example, Definition of &lt;a&gt;anchor tag in HTML5.
HTML5 Anchor Tag Example, Definition of <a> anchor tag in HTML5. In this tutorial, we will introduce you to the <a> anchor tag of HTML5. An Anchor tag is a hyper link. It is used to create a link from one page to another
Anchor tag attributes in HTML5, Define the type attribute of anchor tag.
  In this tutorial, we will see the use of type attribute of anchor tag . The type attribute of anchor tag specifies the MIME (multipurpose internet... syntax of type attribute in anchor tag.      
Anchor tag attributes in HTML5, Define the href attribute of anchor tag.
Anchor tag attributes in HTML5, Define the href attribute of anchor tag. In this tutorial, we will see the use of href attribute of anchor tag . The href attribute of anchor tag holds URL of destination document, which we want
Target attribute in anchor tag, Use of target attribute of anchor tag in HTML5.
Target attribute in anchor tag, Use of target attribute of anchor tag in HTML5. In this tutorial, we will see the use of target attribute of anchor tag...; Declaration Syntax : Declaration syntax of target attribute in anchor tag.  
how to get the anchor field in hidden field tag
how to get the anchor field in hidden field tag  I have a following code I need to have the value of property "emp" in a hidden field also. when i try to put the following code, I cant get the hidden tag when i see the source
Rel attribute in anchor tag, Use of rel attribute in anchor tag.
Rel attribute in anchor tag, Use of rel attribute in anchor tag. Description:You will see the use of rel attribute of anchor tag and how to implement... in anchor tag.           
Change Background color using Custom Tag
Change Background color using Custom Tag In this program, We will create a Custom Tag which changes the background color. JSP Custom Tags : Provide.... The following code snippet shows an empty custom tag:   <td:welcome />
Display Current Date using JSP Custom(user define) Tag
Display Current Date using JSP Custom(user define) Tag In this section, we... & time will display using custom tag. Tag Handler File :  Build... define) tag. JSP Custom Tags : Provide a mechanism to a Web programmer
JSP CUSTOM TAG - Design concepts & design patterns
by using a single tag. For getting information on Custom Tags, visit the following...JSP CUSTOM TAG   I am Barani Kumar I am trying to use jsp custom tag in my web application I want to now advantages in jsp custom tag I want
checkbox custom tag creation in jsf
checkbox custom tag creation in jsf  how to create check box custom tags with the following functionality: 1.there must be two checkboxes 2.when the first box is checked it must populate the names of bikes,when the second
How to read the body content of custom tag?
How to read the body content of custom tag?  I'm unable to read the body content specified between start tag and end tag of a JSP custom tag...); method. I want to read the body content of any custom tag and manipulate
how to call servlet from html page at anchor tag ?
how to call servlet from html page at anchor tag ?  I have a very different problem as i am using netbeans ide 6.9 ml to make a website in java... buttons image and for referrence i use anchor tag {for ex: ()} to go
Custom Iterator Tag in JSP
Custom Iterator Tag in JSP       Example program to make custom iterator tag in JSP This example will demonstrate you how you can make a custom iterator tag in JSP? You can
Hreflang Attribute, Use of hreflang attribute of anchor tag in HTML5.
Hreflang Attribute, Use of hreflang attribute of anchor tag in HTML5.... Declaration Syntax : Declaration syntax of hreflang attribute in anchor tag... href attribute is available. hreflang Attribute : Attribute Value
Error in Custom tag program - JSP-Servlet
Error in Custom tag program  Dear Sir,This is my problem concern to custom tag.Please review.. Browser show: Browser show: Parsing of JSP... be terminated by the matching end-tag "". (line 12, column 3). probably occurred due
Custom Tag example with no attribute and no body
Custom Tag example with no attribute and no body... to make custom tag with no attribute and no body This example demonstrates how one can make custom tag in JSP that has no attribute and no body. There are only
Example of anchor(Ajax) in struts2.2.1
, you will see the use of Ajax(anchor) tag.  Here, we are changing value of div tag with the help of Ajax anchor tag.   1- index.jsp <...;/head> <body><h2>Ajax_Anchor_Tag
What is a Tag Library in JSP
, multiple actions are accessed by using the tags of the JSP whether the tag is standard tag of the JSP or the custom tag that is made by you. Actions in JSP..., you can say that the tag library is a collection of custom tags. The Tag
How to add another option to the select tag using struts2 tag - Struts
How to add another option to the select tag using struts2 tag  Hi, How to add another option to select tag using tag. My scenario... + one additional value in drop down or else normal user to view only drop down
Assign value from a <bean:write> tag to a variable
Assign value from a tag to a variable  I am calling a stored procedure from JSP page which needs an input parameter. This input parameter needs to get the value from bean write tag . How can i do that ?   Please go
JSF commandLink Tag
which is rendered as a anchor tag. And this tag behaves as a command button... of using the tag. Code Description... a hypertext. This is not only a anchor tag. This link behaves like a command
Exporting to excel using display tag?
Exporting to excel using display tag?  Hai , I am implementing pagination in struts.It has export to excel option.When I am clicking on it ,it is displaying a alert box stating "the file you are trying to open
Anchor Tags
Anchor Tags  coding for one link to another new page using anchor tag   Example of Anchor Tag in HTML <a href="http://www.roseindia.net/">RoseIndia Home Page</a>
Set Tag (Data Tag) Example
; tag as  shown in the setTag.jsp page. The set tag is used to assign a value to a variable in a specified scope. The parameters name and value in the tag... Set Tag (Data Tag) Example      
HTTP 500 Internel server error in Custom tag program on Weblogic 8.1 - Java Beginners
HTTP 500 Internel server error in Custom tag program on Weblogic 8.1  ... error when I run the custom tag program on weblogic 8.1. My program Structure... JSPProgram>Home.jsp Home.jsp: It is a Tag Body taglib.tld: 1.0 1.2
how to get the value of a label field of option tag in javascript?
how to get the value of a label field of option tag in javascript?  example <select> <option label="2" value="A">A</option> <option label="5" value="B">B</option> <
Tag Handler in JSP
;    What is a custom tag: The custom tag library... of a tag library, which defines a set of related custom tags and contains the objects that implement the tags. Custom tag libraries allow the java programmer
include tag
am learning struts2 but i have a small doubt i am using include tag. ex welcome to rose India.net include value="myBirthday.jsp" but only display... i am develop one example. ex: welcome to include tag include value=example.jsp
Advertisements
 

 

 

DMCA.com