Can method declared in JSP have HTML tags?

          Hi all,
          Can a method in JSP page have a HTML tags? (e.g. <td> or <tr>
          etc)?
          Can anybody just give a small example for the same?
          Thanks,
          Amar
          

          Thanks Gary,
          The session bean which is invoked from the JSP page, returns a collection of objects. And each object can have child objects also. In the JSP page i want to iterate through the collection to display the data and that's why the method required is recursive. What would be the better approach for this scenario?
          Regards,
          Amar
          "Gary Keim" <[email protected]> wrote:
          >Yes, that will work fine. However, you might want to strive to reach a
          >place where your JSPs are only "looking" at data held by JavaBeans. That
          >is, if you're going to have your JSP doing ANYTHING other than simply being
          >the face on other data, you might as well make it a plain ol' servlet.
          >
          >A common pattern is to have a master servlet do any logic processing, then
          >it redirects to a JSP for the presentation.
          >
          >-Gary
          >
          >"Amar" <[email protected]> wrote in message
          >news:[email protected]...
          >>
          >> Gary Thanks for your reply.
          >>
          >> In the recursive function which i was trying to write, i wanted to display
          >HTML, so that the function is responsible for display of the HTML also (it
          >was not possible to send the HTML back to the calling function and print it
          >in the scriplet, as the function is recursive). But we can use out.print
          >statement in that recursive function by passing the "out" (JSPWriter) object
          >to that function. So instead of putting static text in the function, we can
          >use out.print statements and acheive the same.
          >>
          >> Any suggestion? Any other better way to acheive the same?
          >>
          >> Regards,
          >> Amar
          >>
          >> "Gary Keim" <[email protected]> wrote:
          >> >I responded to Amar privately on this.
          >> >
          >> >-Gary
          >> >
          >> >"Amar" <[email protected]> wrote in message
          >> >news:[email protected]...
          >> >>
          >> >> Hi Gary,
          >> >>
          >> >> Thanks for ur interest. I wanted to write a method (function,
          >procedure)
          >> >in a JSP page, in that i want to write a HTML tags. I tried that but JSP
          >> >compiler throws error for that. Is it that i have to include some other
          >tag?
          >> >Am i missing something.
          >> >>
          >> >> <%!
          >> >> private void displayProxy(ArrayList ObjectsInfo, BaseLW aObj)
          >> >> {
          >> >> ProxyObjectDisplayInfo ObjInfo =
          >> >(ProxyObjectDisplayInfo)ObjectsInfo.get(0);
          >> >> int Cnt = ObjInfo.mColumnNames.size();
          >> >> String Str = new String();
          >> >> for(int j = 0; j < Cnt; j++)
          >> >> {
          >> >> Str = Str + aObj.getColumnValue((String)ObjInfo.mColumnNames.get(j)) +
          >" ,
          >> >";
          >> >> }
          >> >> Str = Str.substring(0, Str.length()-3);
          >> >> String StrHRef = new String();
          >> >> StrHRef = "<a href=\"client?client_id=";
          >> >> StrHRef = StrHRef + aObj.getColumnValue("ClientCode");
          >> >> StrHRef = StrHRef + "\">";
          >> >> try
          >> >> {
          >> >> %>
          >> >> <tr bgcolor=\"#eeebcc\">
          >> >> <td>
          >> >> <%=StrHRef%>
          >> >> <%=Str%>
          >> >> </a>
          >> >> </td>
          >> >> </tr>
          >> >> <%
          >> >> }
          >> >> }
          >> >> %>
          >> >>
          >> >> Regards,
          >> >> Amar
          >> >>
          >> >> Gary Keim <[email protected]> wrote:
          >> >> >Amar,
          >> >> >
          >> >> >I don't think anyone is answering your question because we don't
          >> >> >understand what you are asking. Can you rephrase the question using
          >> >> >standard terminology? For example, what do you mean by "a method in
          >JSP
          >> >> >page?"
          >> >> >
          >> >> >-Gary
          >> >> >
          >> >> >Amar wrote:
          >> >> >
          >> >> >> Hi all,
          >> >> >>
          >> >> >> Can a method in JSP page have a HTML tags? (e.g. <td> or <tr>
          >> >> >> etc)?
          >> >> >>
          >> >> >> Can anybody just give a small example for the same?
          >> >> >>
          >> >> >> Thanks,
          >> >> >> Amar
          >> >> >>
          >> >> >>
          >> >> >
          >> >>
          >> >
          >> >
          >>
          >
          >
          

Similar Messages

  • I want to display BLOB image in JSP Using  html tags IMG src=

    GoodAfternoon Sir/Madom
    I Have got the image from oracle database but want to display BLOB image using <IMG src="" > Html tags in JSP page . If it is possible than please give some ideas or
    Send me sample codes for display image.
    This code is ok and working no problem here Please send me code How to display using html tag from oracle in JSP page.
    <%@ page import="java.sql.*" %>
    <%@ page import="java.io.*" %>
    <%@ page import="javax.swing.ImageIcon;" %>
          <%
            out.print("hiiiiiii") ;
                // declare a connection by using Connection interface
                Connection connection = null;
                /* Create string of connection url within specified format with machine
                   name, port number and database name. Here machine name id localhost
                   and database name is student. */
                String connectionURL = "jdbc:oracle:thin:@localhost:1521:orcl";
                /*declare a resultSet that works as a table resulted by execute a specified
                   sql query. */
                ResultSet rs = null;
                // Declare statement.
                PreparedStatement psmnt = null;
                  // declare InputStream object to store binary stream of given image.
                   InputStream sImage;
                try {
                    // Load JDBC driver "com.mysql.jdbc.Driver"
                    Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
                        /* Create a connection by using getConnection() method that takes
                        parameters of string type connection url, user name and password to
                        connect to database. */
                    connection = DriverManager.getConnection(connectionURL, "scott", "root");
                        /* prepareStatement() is used for create statement object that is
                    used for sending sql statements to the specified database. */
                    psmnt = connection.prepareStatement("SELECT image FROM img WHERE id = ?");
                    psmnt.setString(1, "10");
                    rs = psmnt.executeQuery();
                    if(rs.next()) {
                          byte[] bytearray = new byte[1048576];
                          int size=0;
                          sImage = rs.getBinaryStream(1);
                        //response.reset();
                          response.setContentType("image/jpeg");
                          while((size=sImage.read(bytearray))!= -1 ){
                response.getOutputStream().write(bytearray,0,size);
                catch(Exception ex){
                        out.println("error :"+ex);
               finally {
                    // close all the connections.
                    rs.close();
                    psmnt.close();
                    connection.close();
         %>
         Thanks

    I have done exactly that in one of my applications.
    I have extracted the image from the database as a byte array, and displayed it using a servlet.
    Here is the method in the servlet which does the displaying:
    (since I'm writing one byte at a time, it's probably not terribly efficient but it works)
         private void sendImage(byte[] bytes, HttpServletRequest request, HttpServletResponse response) throws IOException {
              ServletOutputStream sout = response.getOutputStream();
              for(int n = 0; n < bytes.length; n++) {
                   sout.write(bytes[n]);
              sout.flush();
              sout.close();
         }Then in my JSP, I use this:
    <img src="/path-to-servlet/image.jpg"/>
    The name of the image to display is in the URL as well as the path to the servlet. The servlet will therefore need to extract the image name from the url and call the database.

  • ClassCastException in method declaration in JSP page??

    i keep getting this ClassCastException in my jsp page. The line that
    is apparently the problem is the <%! where the method declaration
    starts. I can't seem to figure out why this is happening, can someone
    please help? Here is the full code:
    java.lang.ClassCastException
         at quickfix0itm_0submit__jsp.addUpdate(/epsc/quickfix_itm_submit.jsp:25)
         at quickfix0itm_0submit__jsp._jspService(/epsc/quickfix_itm_submit.jsp:165)
         at com.caucho.jsp.JavaPage.service(JavaPage.java:75)
         at com.caucho.jsp.Page.subservice(Page.java:506)
         at com.caucho.server.http.FilterChainPage.doFilter(FilterChainPage.java:182)
         at com.caucho.server.http.Invocation.service(Invocation.java:315)
         at com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:135)
         at com.caucho.server.http.RunnerRequest.handleRequest(RunnerRequest.java:344)
         at com.caucho.server.http.RunnerRequest.handleConnection(RunnerRequest.java:274)
         at com.caucho.server.TcpConnection.run(TcpConnection.java:139)
         at java.lang.Thread.run(Thread.java:534)
    <%
    if ( (session.getAttribute("setID") == null ) || ( !session.getAttribute("setID").equals(session.getId()) ))
            out.write("You are either not logged in or your session has timed out due to inactivity.<BR>"
                    + "Please <a href=\"index.jsp\">return to the login screen</a> and login again<BR><BR>");
    else
    %>
    <%@ page language=java %>
    <%@ page import='java.sql.*' %>
    <%@ page import='javax.sql.*' %>
    <%@ page import='javax.naming.*' %>
    <%@ page import='java.io.*' %>
    <%@ page import='java.util.Hashtable' %>
    <%@ page import='java.util.Vector' %>
    <%@ page import='java.util.Enumeration' %>
    <%@ page import='java.util.Calendar' %>
    <%@ page import='java.util.GregorianCalendar' %>
    <%!
    private void addUpdate(String[] tmpP, String[] UIDs, String curName, String colName, String lastIdx, Hashtable uid_updates)
         if (curName.equals(colName))
              for (int c = 0; c < UIDs.length; c++)
                   Object[] tmp = (Object[])uid_updates.get(UIDs[c]);
                   Vector colNames = new Vector();
                   Vector colValues = new Vector();
                   if (tmp == null)
                        tmp = new Object[2];
                   else
                        colNames = (Vector)tmp[0];
                        colValues = (Vector)tmp[1];
                   String updateVal = tmpP[0];
                   colNames.add(curName);
                   colValues.add(updateVal);
                   tmp[0] = colNames;
                   tmp[1] = colValues;
                   uid_updates.remove(UIDs[c]);
                   uid_updates.put(UIDs[c], tmp);
         else
              int uidIdx = curName.lastIndexOf(lastIdx);
              String uidcode = curName.substring(uidIdx + 1);
              Object[] tmp = (Object[])uid_updates.get(uidcode);
              Vector colNames = new Vector();
              Vector colValues = new Vector();
              if (tmp == null)
                   tmp = new Object[2];
              else
                   colNames = (Vector)tmp[0];
                   colValues = (Vector)tmp[1];
              //String[] tmpP = request.getParameterValues(curName);
              String updateVal = tmpP[0];
              colNames.add(colName);
              colValues.add(updateVal);
              tmp[0] = colNames;
              tmp[1] = colValues;
              uid_updates.remove(uidcode);
              uid_updates.put(uidcode, tmp);
    %>
    <%
    String ss = "0";
    String force_noon = "0";
    String qfix_duration = "2";
    int qfixd = 2;
    String mod_keys = "";
    String[] mktmp = request.getParameterValues("mod_keys");
    if (mktmp == null)
         out.print("Error! Please go back and try again.");
    else
         mod_keys = mktmp[0];
    Hashtable uid_updates = new Hashtable();
    String[] UIDs = new String[1];
    if (mod_keys.equals("1"))
         UIDs = request.getParameterValues("UID");
         for (int storeUIDs = 0; storeUIDs < UIDs.length; storeUIDs++)
              Vector tmp = new Vector();
              uid_updates.put(UIDs[storeUIDs], tmp);
    Enumeration cols = request.getParameterNames();
    while (cols.hasMoreElements())
         String curName = (String)cols.nextElement();
         if (curName.indexOf("BusName") != -1)
              addUpdate(request.getParameterValues(curName), UIDs, curName, "BusName", "e", uid_updates);
         else if (curName.equals("ss"))
              String[] asdfadf  = request.getParameterValues(curName);
              if (asdfadf != null)
                   ss = "1";
              else
                   ss = "0";
         else if (curName.equals("force_noon"))
              String[] asdfadf  = request.getParameterValues(curName);
              force_noon = asdfadf[0];
         else if (curName.equals("qfix_duration"))
              String[] asdfadf  = request.getParameterValues(curName);
              qfix_duration = asdfadf[0];
              qfixd = Integer.parseInt(qfix_duration);
         else if (curName.indexOf("DisplayLine") != -1)
              addUpdate(request.getParameterValues(curName), UIDs, curName, "DisplayLine", "e", uid_updates);
         else if (curName.indexOf("CityName") != -1)
              addUpdate(request.getParameterValues(curName), UIDs, curName, "CityName", "e", uid_updates);
         else if (curName.indexOf("PAC") != -1)
              addUpdate(request.getParameterValues(curName), UIDs, curName, "PAC", "C", uid_updates);
         else if (curName.indexOf("ProvDisp") != -1)
              addUpdate(request.getParameterValues(curName), UIDs, curName, "ProvDisp", "p", uid_updates);
         else if (curName.indexOf("TeleNum") != -1)
              addUpdate(request.getParameterValues(curName), UIDs, curName, "TeleNum", "m", uid_updates);
         else if (curName.indexOf("ProvCode") != -1)
              addUpdate(request.getParameterValues(curName), UIDs, curName, "ProvCode", "e", uid_updates);
         else if (curName.indexOf("Dircode") != -1)
              addUpdate(request.getParameterValues(curName), UIDs, curName, "Dircode", "e", uid_updates);
         else if (curName.indexOf("Hdgcode") != -1)
              addUpdate(request.getParameterValues(curName), UIDs, curName, "Hdgcode", "e", uid_updates);
         else if (curName.indexOf("EMail") != -1)
              addUpdate(request.getParameterValues(curName), UIDs, curName, "EMail", "l", uid_updates);
         else if (curName.indexOf("URL") != -1)
              addUpdate(request.getParameterValues(curName), UIDs, curName, "URL", "L", uid_updates);
         else if (curName.indexOf("DispAd") != -1)
              addUpdate(request.getParameterValues(curName), UIDs, curName, "DispAd", "d", uid_updates);
         else if (curName.indexOf("TOPlus") != -1)
              addUpdate(request.getParameterValues(curName), UIDs, curName, "TOPlus", "s", uid_updates);
         else if (curName.indexOf("EStore") != -1)
              addUpdate(request.getParameterValues(curName), UIDs, curName, "EStore", "e", uid_updates);
         else if (curName.indexOf("HSLINE_EN") != -1)
              addUpdate(request.getParameterValues(curName), UIDs, curName, "HSLINE_EN", "N", uid_updates);
         else if (curName.indexOf("HSLINE_FR") != -1)
              addUpdate(request.getParameterValues(curName), UIDs, curName, "HSLINE_FR", "R", uid_updates);
         else if (curName.indexOf("MtlPlus") != -1)
              addUpdate(request.getParameterValues(curName), UIDs, curName, "MtlPlus", "s", uid_updates);
         else if (curName.indexOf("CalPlus") != -1)
              addUpdate(request.getParameterValues(curName), UIDs, curName, "CalPlus", "s", uid_updates);
         else if (curName.indexOf("EdmPlus") != -1)
              addUpdate(request.getParameterValues(curName), UIDs, curName, "EdmPlus", "s", uid_updates);
         else if (curName.indexOf("VanPlus") != -1)
              addUpdate(request.getParameterValues(curName), UIDs, curName, "VanPlus", "s", uid_updates);
         else if (curName.indexOf("DEALER_LOCATOR") != -1)
              addUpdate(request.getParameterValues(curName), UIDs, curName, "DEALER_LOCATOR", "R", uid_updates);
    long curTime = System.currentTimeMillis();
    long monthMS = 2629743832L;
    long expLength = monthMS * qfixd;
    long expTime = curTime + expLength;
    java.sql.Date d1 = new java.sql.Date(System.currentTimeMillis());
    String Start_Date = d1.toString();
    d1 = new java.sql.Date(expTime);
    String Expiry_Date = d1.toString();
    Context env1 = (Context) new InitialContext().lookup("java:comp/env");
    DataSource source1 = (DataSource) env1.lookup("jdbc/epsc");
    Connection conn1 = source1.getConnection();
    String Pub_ID = "";
    try {
         Enumeration uidKeys = uid_updates.keys();
         while (uidKeys.hasMoreElements())
              String Unique_ID = (String)uidKeys.nextElement();
              Object[] updateData = (Object[])uid_updates.get(Unique_ID);
              Vector colNames = (Vector)updateData[0];
              Vector colValues = (Vector)updateData[1];
              String selectRecord = "SELECT * from epsc_ypca WHERE Unique_ID='" + Unique_ID + "';";
              Statement getRecord = conn1.createStatement();
              ResultSet returned = getRecord.executeQuery(selectRecord);
              Pub_ID = returned.getString("Pub_ID");
              boolean createDelete = false;
              String updateString = "";
              for (int b = 0; b < colNames.size(); b++)
                   if (b != 0)
                        updateString = updateString + ", ";
                   String colName = (String)colNames.get(b);
                   String colVals = (String)colValues.get(b);
                   if (colName.equals("BusName") || colName.equals("DisplayLine") || colName.equals("ProvDisp") || colName.equals("CityName") || colName.equals("PAC") || colName.equals("TeleNum"))
                        if (!((returned.getString(colName)).equals(colVals)))
                             createDelete = true;
                   updateString = updateString + colName + "='" + colVals + "'";
              if (createDelete)
                   //create delete
                   String delFromQuickfixes = "DELETE FROM epsc_quickfixes WHERE Start_Date='" + Start_Date + "' AND Pub_ID='" + Pub_ID + "' AND QFix_Type='2';";
                   Statement delItm = conn1.createStatement();
                   delItm.execute(delFromQuickfixes);
                   String insertQfixDel = "INSERT INTO epsc_quickfixes SELECT *, '0' as UID, '" + Start_Date + "' as Start_Date, '" + Expiry_Date + "' as Expiry_Date, '2' as QFix_Type, '0' as ss, '" + force_noon + "' as force_noon FROM epsc_ypca WHERE Pub_ID='" + Pub_ID + "' AND (Record_Ind='2' OR Record_Ind='4' OR Record_Ind='6');";
                   Statement insertQFDEL = conn1.createStatement();
                   insertQFDEL.execute(insertQfixDel);
              String updateRecords = "UPDATE epsc_ypca SET " + updateString + " WHERE Unique_ID='" + Unique_ID + "';";
         String selectAndInsert = "INSERT INTO epsc_quickfixes SELECT *, '0' as UID, '" + Start_Date + "' as Start_Date, '" + Expiry_Date + "' as Expiry_Date, '3' as QFix_Type, '" + ss + "' as ss, '" + force_noon + "' as force_noon FROM epsc_ypca WHERE Pub_ID='" + Pub_ID + "';";
         Statement insertIntoQfix = conn1.createStatement();
         insertIntoQfix.execute(selectAndInsert);
         out.write("Quickfix Successfully submitted.<BR><BR>\r\n");
    catch (SQLException e)
            out.write("<h1>SQL ERROR: " + e.getMessage() + "<BR><BR>Please report to administrator</h1>");
    finally{
            conn1.close();
    %>
    <BR><BR>[ <a href="menu.jsp">Return To Main</a> ]
    </center>
    </BODY>
    </HTML>
    <%
    %>

    it is the exact same as the one i originally posted:
    500 Servlet Exception
    java.lang.ClassCastException
         at quickfix0itm_0submit__jsp.addUpdate(/epsc/quickfix_itm_submit.jsp:24)
         at quickfix0itm_0submit__jsp._jspService(/epsc/quickfix_itm_submit.jsp:169)
         at com.caucho.jsp.JavaPage.service(JavaPage.java:75)
         at com.caucho.jsp.Page.subservice(Page.java:506)
         at com.caucho.server.http.FilterChainPage.doFilter(FilterChainPage.java:182)
         at com.caucho.server.http.Invocation.service(Invocation.java:315)
         at com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:135)
         at com.caucho.server.http.RunnerRequest.handleRequest(RunnerRequest.java:344)
         at com.caucho.server.http.RunnerRequest.handleConnection(RunnerRequest.java:274)
         at com.caucho.server.TcpConnection.run(TcpConnection.java:139)
         at java.lang.Thread.run(Thread.java:534)

  • Can we declare more than one sequence tags in a complex type?

    Hi all,
    Can we use more than one <sequence> tags in the xml schema?
    <xs:complexType name="Demo">
    <xs:sequence minoccurs = "1" maxoccurs = "1">
    </xs:sequence>
    <xs:sequence minoccurs = "0" maxoccurs = "1">
    </xs:sequence>
    </xs:complexType>
    If you observe the above sample xml there are two sequences in one complex type with different values for minoccurs and maxoccurs. Is this xml valid? why I need this is I have an
    XML with lot of elements some of them should have minoccurs = "1" maxoccurs = "1" and some other should have the other combination of min and max attributes. I want to
    declare it in the sequence rather than declaring beside each individual element. is that possible?
    Thanks.

    Hi,
    Is this xml valid? No, a complexType expects only one child, but you can do this :
    <xs:complexType name="Demo">
      <xs:sequence>
        <xs:sequence minOccurs = "1" maxOccurs = "1">
        </xs:sequence>
        <xs:sequence minOccurs = "0" maxOccurs = "1">
        </xs:sequence>
      </xs:sequence>
    </xs:complexType>However...
    XML with lot of elements some of them should have minoccurs = "1" maxoccurs = "1" and some other should have the other combination of min and max attributes.
    I want to declare it in the sequence rather than declaring beside each individual element. is that possible?minOccurs and maxOccurs declared in the sequence apply to the sequence as a whole, not to its individual components.
    For example :
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
         <xs:complexType name="Demo">
              <xs:sequence>
                   <xs:sequence maxOccurs="1" minOccurs="1">
                        <xs:element name="test1" type="xs:string"/>
                        <xs:element name="test2" type="xs:string"/>
                   </xs:sequence>
                   <xs:sequence maxOccurs="1" minOccurs="0">
                        <xs:element name="test3" type="xs:string"/>
                        <xs:element name="test4" type="xs:string"/>
                   </xs:sequence>
              </xs:sequence>
         </xs:complexType>
         <xs:element name="root" type="Demo"/>
    </xs:schema>What you expect will work for the first sequence of elements (test1 and test2) but anyway minOccurs and maxOccurs for elements default to 1, so why bother wrapping them in a sequence?
    If I understand what you want correctly, it won't work for the second sequence.
    For instance, this will be valid :
    <root>
      <test1/>
      <test2/>
      <test3/>
      <test4/>
    </root>but this will not :
    <root>
      <test1/>
      <test2/>
      <test3/>
    </root>

  • How to have HTML tags in Flex app wrapper.

    If I put this just below the <body> tag in my Flex app
    HTML wrapper, it displays:
    <h2>Greg Lafrance</h2>
    But if I put that tag just above the ending </body>, it
    does not show up.
    I'm sure it is something simple, but can someone please
    enlighten me?

    Hi,
    overflow property will tell the browser to hide the content
    if it is overflowing the available space. Please find more details
    at the URL below.
    http://www.w3schools.com/Css/pr_pos_overflow.asp
    IE is ignoring this style property and so we have scroll
    property for the BODY tag also. As Tracy mentioned, these are set
    to make sure Flex application occupies the browser.
    Hope this helps.

  • Help: OJSPC can not compile the JSP with struts tag

    Hi,
    I am trying to precompile the JSP page with EAR package but OJSPC can not parse the Struts tags.
    I always get oracle.jsp.parse.JspParseException:
    Error: org.apache.struts.taglib.html.MessgesTei while reading TLD /WEB-INF/tld/struts-html.tld
    My OC4J version is 10.1.3.2 and I did tried putting the struts-taglib.jar to /opt/oracle/product/app10g/j2ee/home/jsp/lib or /lib/taglib
    but still do not work.
    Can anyone tell me how to configure the OJSPC and let it support customerized taglibs?
    Thanks a lot!

    This is a new problem with jdk1.4 when compiling with tomcat.
    The solution is to ensure that any classes in WEB-INF/classes are in a package structure and the relevant jsp calls the same using the package name.
    best
    kev

  • JSP with HTML tags ?

    I`m using Eclipse as developing environment for my project.
    When I chose "create new JSP" I get all the following:
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
        pageEncoding="ISO-8859-1"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Insert title here</title>
    </head>
    <body>
    ...Do I need this HTML-structure for a jsp action or can I just start with
    <%
    my code
    %>
    Thank you!

    fankoff wrote:
    Do I need this HTML-structure for a jsp action or can I just start with Eclipse is generating the code snippet from template to help you write your JSP file faster. You may directly start with scriptlet (<% Java code here %>) and not use HTML code at all in the page depending on your requirement. First decide the intention of your JSP file whether it is meant for dynamic content generation or only processing.
    Thanks,
    Mrityunjoy

  • Struts portlet Instance Label problem: Appending the html tags in jsp

    I have created a struts portlet and given it a Instance Label. I have used struts-adapter-html.tld tld in my jsp which is referenced by my struts portlet. But the problem with using this taglib is that the portlet Instance Label is appended to all the html tags on the JSP as a result of which when the page is submitted, formbean will not pick any of the values as the name will not match. Has anyone has faced this kind of problem? How can I prevent the appending of the HTML tags with the portlet Instance Label?
    Please help me overcome this problem..
    Thanks in Advance ...

    1. To begin with, I would not recommend NOT to append portlet instance label to html tags. This is very much required. Take atleast 2 scenarios. If you dropped 2 instances for Same Portlet like News/Articles portlet etc on same page, you need to identify the html fields uniquely for each portlet so that backend java code works properly. Also if you have 2 different portlets assuming you did not give any name to form tag, and if you have html tags with same name, you need to identify them. Remember when portal or desktop is rendered, it is one big html file with html fragmetns from all .portlets files. So I am not sure if there is any option at all, to avoid the appending of instance label value to html tags.
    2. Coming to your usecase, I did had this problem once in 8.1 SPxx long back. All we did was, in the back end code, using BackingFile we could get the intance label value of the portlet. We can get this in pageflow also. Then pass this value and manually append this value to the html field of interest. In your case looks like you have Struts and tld tags. See somehow if you can get portlet instance label in jsp file and pass around to your tag lib code in request parameters etc. This is just one idea. I am not fully aware of your code, so try something along these lines.
    HTH
    Ravi Jegga

  • HTML tags inside XML

    I am using jsp to read a xml file and display it on the browser. Some of the elements of this xml file have html tags embedded inside them. Right now when I use a <x:out ...>, I get only the text from the element and the html tags get ignored. How do get the html tags to also work?
    example
    <ELEM1>
    For any questions <b>contact</B> us at e-mail
    <ELEM1>

    Set xslt output as html/text.
    <xsl:output method="html/text" />
    <xsl:copy-of select="ELEM1"/>

  • Html tags in pdf printing

    Hi ,
    I have a pl/sql region which I use to display a report .
    Now I want a Pdf output of this pl/sql region. For this I used the Bi publisher and was able to design the report query and report layout as required.
    However my problem is that some of the columns in my table have html tags (since the input for these column is through an text area with html editor) . When the PDF is generated the html tags are not converted.
    Please advice me on this.
    Thanks,
    Deepa
    Edited by: Deepa J on Sep 25, 2008 6:01 AM

    Hi Deepa.
    You wont get the HTML to be interpreted in the BI Publisher output I'm afraid.
    You'll need to wait for APEX 4.0 for that functionality.
    If you're seeing the HTML tags in your PDF and you use a Classic report region you can try selecting the "Strip HTML" option in the Layout and Pagination settings.
    Regards
    Simon Gadd

  • HTML Tags in XML Update

    I have a unique situation (may be not that unique). I want to update or add HTML tags in an XML element I am writing a PL/SQL Stored Procedure to insert, update or delete elements/attributes from an XML Type column based on the input XML (coming from Java application). SP is called from Java app. For example my XML may loook like
    <Description Name="Sales Message">
    <Text>This is a test</Text>
    </Description>
    I can update this in XML by creatinga SP which accepts a value (clob or text) and make a simple update call like
    UPDATE table_name
    SET hotel_xml = UPDATEXML (hotel_xml, Description[@Name=''Sales Message'']/Text/text()', 'This is a Test')
    WHERE id = 123;
    Hopwever when I have HTML tags in my parameter value, my update fails. For example java pp passes me a string
    This is a bold &lt;B&gt;Test&lt;/B&gt;
    (without encoding it is "This is a Bold <B>Test</B>"
    When I run this
    UPDATE table_name
    SET hotel_xml = UPDATEXML (hotel_xml, Description[@Name=''Sales Message'']/Text/text()', 'This is a bold &lt;B&gt;Test&lt;/B&gt;')
    WHERE id = 123;
    It thinks, I am passing a substitution variable (think &lt and &gt as sub variables) and the procedure fails.
    How do I handle HTML encoded charcters in Oarcle Pl/SQL? Many of my SPs has to accept XML as clob that may contain HTML encoding. Java always encodes HTML tags in an XML so I have to pass the CLOB(xml) to a SP as it is

    When this type of encoding is there in my XML or input variable, PL/SQL thinks
    its a substitution variable and tries to replace it by prompting replacement. I think »substitution variables« is the wrong phrase for this. Probably you mean »entity names«, and all that happens is that special characters are converted to »entity names« to ensure valid xml after the update:
    SQL> with table_name as (
    select xmltype('<Description Name="Sales Message">
                       <Text>This is a test</Text>
                     </Description>') hotel_xml from dual)
    select updatexml (hotel_xml,
                      'Description[@Name="Sales Message"]/Text/text()',
                      'This is a bold <B>Test</B>'
                     ) hotel_xml
      from table_name
    HOTEL_XML                                                                                             
    <Description Name="Sales Message"><Text>This is a bold &amp;lt;B&amp;gt;Test&amp;lt;/B&amp;gt;</Text></Description> Do you expect your result to look like
    <Description Name="Sales Message">
      <Text>This is a bold <B>Test</B></Text>
    </Description>??

  • HTML tags in text-only e-mail notification (with HTML attachment)

    Greetings,
    Our "Purchase Order Review" e-mail notifications (as generated by the WF-Mailer) have HTML tags in the message body (which is "plain-text" text-only), with an HTML attachment. (The attachment looks good, and is what we are expecting.) All our e-mail notifications are text-only (which is how we want them), and this is the only kind of notification that is generating HTML tags in the 'text-only' message body.
    We'd like to keep the HTML attachment as it is, but we want to have the e-mail message body be text (without any HTML tags). The other option that would be acceptable is to NOT have any message content at all, and only the HTML attachment.
    Can either of these options be done, and how do we go about doing them?? Thanks!! -- Tom
    Tom Buck
    [email protected]
    PS: Here is a partial sample of the "text-only" message content...
    <HTML><HEAD></HEAD>
    <BODY BGCOLOR="#FFFFFF"><b>Oracle Workflow Notification (FYI)</b>
    <br>
    <hr>
    <P><table width=100% border=0 cellpadding=2 cellspacing=1 cols=3 rows=2>
    <!-- header -->
    <tr>
    <!-- ORACLE, ship-to, PURCHASE-ORDER -->
    <td width=45% valign=top>
    <!-- ORACLE -->
    <font color=black size=+2>
    BUTLER MANUFACTURING
    </font><br>
    <font color=black> BUTLER MANUFACTURING COMPANY
    <br> BUTLER MANUFACTURING HEADQUARTERS
    <br> 1540 GENESSEE ST.
    <br> KANSAS CITY
    , MO
    64102
    <br> US
    </font> </br>
    </td>
    <td width=25% valign=top>
    <!-- ship-to -->
    etc..., for another couple hundred lines. -- Tom

    in the notifications properties you will see two tabs, in one you can enter your message in text and in another you can enter in html. not sure if you had tried these.
    hth
    satish paul
    Greetings,
    Our "Purchase Order Review" e-mail notifications (as generated by the WF-Mailer) have HTML tags in the message body (which is "plain-text" text-only), with an HTML attachment. (The attachment looks good, and is what we are expecting.) All our e-mail notifications are text-only (which is how we want them), and this is the only kind of notification that is generating HTML tags in the 'text-only' message body.
    We'd like to keep the HTML attachment as it is, but we want to have the e-mail message body be text (without any HTML tags). The other option that would be acceptable is to NOT have any message content at all, and only the HTML attachment.
    Can either of these options be done, and how do we go about doing them?? Thanks!! -- Tom
    Tom Buck
    [email protected]
    PS: Here is a partial sample of the "text-only" message content...
    <HTML><HEAD></HEAD>
    <BODY BGCOLOR="#FFFFFF"><b>Oracle Workflow Notification (FYI)</b>
    <br>
    <hr>
    <P><table width=100% border=0 cellpadding=2 cellspacing=1 cols=3 rows=2>
    <!-- header -->
    <tr>
    <!-- ORACLE, ship-to, PURCHASE-ORDER -->
    <td width=45% valign=top>
    <!-- ORACLE -->
    <font color=black size=+2>
    BUTLER MANUFACTURING
    </font><br>
    <font color=black> BUTLER MANUFACTURING COMPANY
    <br> BUTLER MANUFACTURING HEADQUARTERS
    <br> 1540 GENESSEE ST.
    <br> KANSAS CITY
    , MO
    64102
    <br> US
    </font> </br>
    </td>
    <td width=25% valign=top>
    <!-- ship-to -->
    etc..., for another couple hundred lines. -- Tom

  • HTML tags in Report

    Hi,
    I am trying to create a report using APEX. I am using a word template - report layout. but some of the columns does have html tags in the data itself. (eg <b> etc) How can I get to display this in my report.
    Also for some Fields I am using the Old English Text font we have in Word. But when it comes to display the report in PDF those special fonts are displayed as ordinary ones. any IDea how to get this working?
    Thanks
    Meenu

    Hi Meenu,
    This is the same problem as in another thread where you replied. I don't have an answer yet. The problem is probably due to the html data is rendered when you show it in a browser but doesn't get rendered when printing in pdf (by BI Publisher).
    I see some possibilities:
    - call a function in plsql that transforms your html to xml and sent that to BIP
    - configure BIP so that it gets rendered correctly
    I don't have the answer right now. I hope Marc can answer it before, otherwise I'll investigate it in a week.
    Dimitri

  • Parse out the contents of meta tag using HTML.Tag

    I need help with using the HTML.Tag class. I don't even know where to start...
    I want to make a method that allows me to pass in a very long string and the NAME of the meta tag.. and will return the contents of the meta tag.. any help will be super..
    sorry i do not have much of a code base to start with.. I am just guessing on how to get this to work..
    private String getMetatag(String content,String Metaname)
    String Metacontents;
    Object HTML.Tag.META;
    Object HTML.Attribute.NAME.Metaname;
         Object HTML.Attribute.CONTENT;
    return Metacontents;
    }

    One of the way to get started is to check out how to overide (extend) the class
    HTMLEditorKit.ParserCallback.. Lets say the class is called class A
    Overide the methods for
    HandleSImpleTags( HTML.Tag t, AttributeSet attribute, int pos) { }
    roughly, the implemenation in that method is like this:
    HandleSImpleTags( HTML.Tag t, AttributeSet attribute, int pos) {
    if(t.equals(HTML.Tag.META) {
    /// your procedure, what to do when encounter META tag
    // String str = (String) attribute.getAttribute(HTML.Attribute.NAME);
    // System.out.println(str);
    You would still need to find some detail examples on how to use class A .
    Roughly it is,
    parser.parse(inputstream, an_instance of_class_A, true); // method in a outer class like a main class
    parser is a instatiation of from the method getParser. This method need to be overidden as well.

  • Are templates able to update code above html tag?

    Is it possible to use templates to update code preceding the
    doctype declaration and/or the html tag? I am trying to insert php
    code (relating to sessions) and have tried (I believe) all possible
    variants of codeOutsideHTMLIsLocked="false" or "true", combined
    with trying to insert an editable region at the top, etc. I am not
    able to find a solution that works. I may trick DW to insert the
    code site wide, but then it will not update the code nor delete it.
    colin

    Cole.Mountain please try the steps listed in Error "Failed to Install" Creative Cloud Desktop application - http://helpx.adobe.com/creative-cloud/kb/failed-install-creative-cloud-desktop.html to install the updated version of the Creative Cloud Desktop application.

Maybe you are looking for

  • HT4314 I can't log in to my game center account.

    It wants my Apple ID and password. I put them in (the same ones I used to log onto this apple support site and my iTunes account). But it says they aren't right. So here's my question. My daughter set up my game center account. Is it possible the App

  • Use Global Conditions when Deploying an Application to a User

    Hi, Use Global Conditions when Deploying an Application to a User: I would like to deploy App-V Application with User centic in mind. The problem is that when the user login to a specefic typ of desktop the application shall be deployed. But if the u

  • SX40 poor quality videos

    My SX40 has never given very good videos, at any resolution.  I figured it was just the nature of the beast, but I have seen some demos recently on YouTube of videos from SX40 that are phenomenal.  It is 2 years old and never did work like I expected

  • Debugger variables invisible

    My problem is i  cant see the variables here.  Can anyone help me out. thanks.

  • With each download/upgrade, I am losing more songs

    I should have been concerned about this earlier, but periodically, some of my tunes disappear or I find the tune and iTunes says that it can not find the original tune. Neither can I. I put my playlist on a removable hard disk drive. Everything worke