ListIterator not working in JSP page

Hello,
I am using an ArrayList in a JSP as follows:
<%
ArrayList missingFieldsArr = (ArrayList) HeaderBean.getMissingFieldsArr();
ListIterator i = (ListIterator)missingFieldsArr.listIterator();
%>
<hbj:scrollContainer
  id="scrContError"
  width="320"
  height="50"
>
  <table width="60%">
  <% while(i.hasNext()) {
    String str = (String) i.next();
  %>
    <tr>
      <td width="100%"> 
        <hbj:textView
       id="txtErrorLst"
       wrapping="true"
       text="<%=str%>"
     />     
     </td>
   </tr>     
  <% } %>
  </table>
</hbj:scrollContainer>
Iterating through the ArrayList works when I test via portalapp.xml in NDS, but it does not when I test via the iview in the Portal.  The error I'm receiving is:
Portal Runtime Error
An exception occurred while processing a request for :
iView : pcd:portal_content/com.nbcuni.sc_portal_Content/com.nbcuni.Roles/com.nbcuni.SAP_SC_Testing_Pre-Bom/com.nbcuni.product_information_prebom_ws/com.nbcuni.pre_bom_pg/com.nbcuni.pre_bom
Component Name : PBS.Inbox
The exception was logged. Inform your system administrator..
Exception id: 06:37_30/12/05_0106_4554750
See the details for the exception ID in the log file
Any thoughts? 
Thanks for your help,
-Jamie

Hi Jamie,
for what reason do you think it's the list iterator? All you know from the info you have passed through to us, that it is your component...
> Exception id: 06:37_30/12/05_0106_4554750
> See the details for the exception ID in the log file
==> Please submit the detailed exception / message / stacktrace from the default.X.trc file.
Best regards
Detlev

Similar Messages

  • Urgent: SAX parser bean is not working in JSP page

    Hi All,
    I have created a bean "ReadAtts" and included into a jsp file using
    "useBean", It is not working. I tried all possibilities. But Failed Plz Help me.
    Below are the details:
    Java Bean: ReadAtts.java
    package sax;
    import java.io.*;
    import javax.xml.parsers.SAXParser;
    import javax.xml.parsers.SAXParserFactory;
    import java.util.*;
    import org.xml.sax.*;
    import org.xml.sax.helpers.DefaultHandler;
    import javax.xml.parsers.ParserConfigurationException;
    public class ReadAtts extends DefaultHandler implements java.io.Serializable
         private Vector attNames = new Vector(); //Stores all the att names from the XML
         private Vector attValues = new Vector();
         private Vector att = new Vector();
         private Locator locator;
         private static String start="",end="",QueryString="",QString1="",QString2="";
    private static boolean start_collecting=false;
         public ReadAtts()
         public Vector parse(String filename,String xpath) throws Exception
    QueryString=xpath;
         StringTokenizer QueryString_ST = new StringTokenizer(QueryString,"/");
         int stLen = QueryString_ST.countTokens();
         while(QueryString_ST.hasMoreTokens())
              if((QueryString_ST.countTokens())>1)
              QString1 = QueryString_ST.nextToken();
    else if((QueryString_ST.countTokens())>0)
                   QString2 = QueryString_ST.nextToken();
         SAXParserFactory spf =
    SAXParserFactory.newInstance();
    spf.setValidating(false);
    SAXParser saxParser = spf.newSAXParser();
    // create an XML reader
    XMLReader reader = saxParser.getXMLReader();
    FileReader file = new FileReader(filename);
    // set handler
    reader.setContentHandler(this);
    // call parse on an input source
    reader.parse(new InputSource(file));
         att.add("This is now added");
         //return attNames;
    return att;
    public void setDocumentLocator(Locator locator)
    this.locator = locator;
    public void startDocument() {   }
    public void endDocument() {  }
    public void startPrefixMapping(String prefix, String uri) { }
    public void endPrefixMapping(String prefix) {  }
    /** The opening tag of an element. */
    public void startElement(String namespaceURI, String localName,String qName, Attributes atts)
    start=localName;
    if(start.equals(QString2))
    start_collecting=true; //start collecting nodes
    if(start_collecting)
    if((atts.getLength())>0)
    for(int i=0;i<=(atts.getLength()-1);i++)
    attNames.add((String)atts.getLocalName(i));
    attValues.add((String)atts.getValue(i));
    /** The closing tag of an element. */
    public void endElement(String namespaceURI, String localName, String qName)
    end = localName;
    if(end.equals(QString2))
         start_collecting=false; //stop colelcting nodes
    /** Character data. */
    public void characters(char[] ch, int start, int length) { }
    /** Ignorable whitespace character data. */
    public void ignorableWhitespace(char[] ch, int start, int length){ }
    /** Processing Instruction */
    public void processingInstruction(String target, String data) { }
    /** A skipped entity. */
    public void skippedEntity(String name) { }
    public static void main(String[] args)
    String fname=args[0];
    String Xpath=args[1];
    System.out.println("\n from main() "+(new ReadAtts().parse(fname,Xpath)));
    //System.out.println("\n from main() "+new ReadAtts().attNames());
    //System.out.println("\n from main() "+new ReadAtts().attValues());
    JSP File:
    <%@ page import="sax.*,java.io.*,java.util.*,java.lang.*,java.text.*;" %>
    <jsp:useBean id="p" class="sax.ReadAtts"/>
    Data after Parsing is.....
    <%=p.parse"E:/Log.xml","/acq/service/metrics/system/stackUsage")%>
    Expected Output:
    The jsp file should print all the vector objects from the "ReadAtts" bean
    Actual Output:
    Data after Parsing.......[]
    Thanks for your time.....
    Newton
    Bangalore. INDIA

    the problem is not because of java code insdie jsp page
    I have removed all things but the form and it is still not working
    here is the modified code:
    <!-- add news-->
    <%
    if(request.getParameter("addBTN") != null){
            out.print("addBTN");
    %>
    <!-- end of add news-->
    <form action="" method="post" enctype="multipart/form-data" name="upform" >
      <table width="99%" border="0" align="center" cellpadding="1" cellspacing="1">
        <tr>
          <td colspan="2" align="right" bgcolor="#EAEAEA" class="borderdTable"><p>'6'A) .(1 ,/J/</p></td>
        </tr>
        <tr>
          <td width="87%" align="right"><label>
            <input name="title" type="text" class="rightText" id="title">
          </label></td>
          <td width="13%" align="right">9FH'F 'D.(1</td>
        </tr>
        <tr>
          <td align="right"><textarea name="elm1" cols="50" rows="10" id="elm1" style="direction:rtl" >
              </textarea></td>
          <td align="right">*A'5JD 'D.(1</td>
        </tr>
        <tr>
          <td align="right"><label>
            <input type="file" name="filename" id="filename">
          </label></td>
          <td align="right">5H1)</td>
        </tr>
        <tr>
          <td align="right"><label>
            <input name="addBTN" type="submit" class="btn" id="addBTN" value="  '6'A) .(1 ">
          </label></td>
          <td align="right"> </td>
        </tr>
      </table>
    </form>
    <!-- TinyMCE -->
    <script type="text/javascript" src="jscripts/tiny_mce/tiny_mce.js"></script>
    <script type="text/javascript">
            tinyMCE.init({
                    mode : "textareas",
                    theme : "simple",
                    directionality : "rtl"
    </script>
    <!--end of TinyMCE -->

  • HTML multipart form is not working in jsp page

    Hi
    i have jsp page, has a HTML from with file upload field , when i click the send button , nothing happened as if the button did not submit the form. ie the message at line 12 is not printed out.
    can any one help please.
    <%@ page errorPage="..\error\error.jsp" %>
    <%@ page pageEncoding="windows-1256" %>
    <%@ page language="java" import="javazoom.upload.*,java.util.*,java.sql.ResultSet" %>
    <jsp:useBean id="upBean" scope="page" class="javazoom.upload.UploadBean" >
      <jsp:setProperty name="upBean" property="folderstore" value="<%=request.getRealPath("thuraya//uploads")%>"  />
    </jsp:useBean>
    <jsp:useBean id="dbc" class="mypackage.DBConnection" scope="session" />
    <!-- add news-->
    <%
    if(request.getParameter("addBTN") != null){
            out.println("addbtn");
            //do upload file + insert in database
             if (MultipartFormDataRequest.isMultipartFormData(request))
             // Uses MultipartFormDataRequest to parse the HTTP request.
             MultipartFormDataRequest mrequest = new MultipartFormDataRequest(request);
             String todo = null;
             if (mrequest != null) todo = mrequest.getParameter("todo");
                 if ( (todo != null) && (todo.equalsIgnoreCase("upload")) )
                    Hashtable files = mrequest.getFiles();
                    if ( (files != null) && (!files.isEmpty()) )
                        UploadFile file = (UploadFile) files.get("filename");
                        if (file != null)
                                            out.println("<li>Form field : uploadfile"+"<BR> Uploaded file : "+file.getFileName()+" ("+file.getFileSize()+" bytes)"+"<BR> Content Type : "+file.getContentType());
                                            String fileName=file.getFileName();
                                            String ran=System.currentTimeMillis()+"";
                                            String ext=fileName.substring(   ( fileName.length()-4),fileName.length() );
                                            file.setFileName(ran+ext);
                        // Uses the bean now to store specified by jsp:setProperty at the top.
                        upBean.store(mrequest, "filename");
                                            String title=request.getParameter("title");
                                            String content=request.getParameter("elm1");
                                            int x=dbc.addNews(title,content,file.getFileName(),2,1);
                                            if(x==1)
                                                     out.print("New Vedio has been addedd Successfully");
                                                      response.setHeader("Refresh","1;URL=uploadVedio.jsp");
                                                     else{
                                                      out.print("An Error Occured while adding new Vedio");
                                                      response.setHeader("Refresh","1;URL=uploadVedio.jsp");
                    else
                      out.println("<li>No uploaded files");
             else out.println("<BR> todo="+todo);
    %>
    <!-- end of add news-->
    <form action="" method="post" enctype="multipart/form-data" name="upform" >
      <table width="99%" border="0" align="center" cellpadding="1" cellspacing="1">
        <tr>
          <td colspan="2" align="right" bgcolor="#EAEAEA" class="borderdTable"><p>'6'A) .(1 ,/J/</p></td>
        </tr>
        <tr>
          <td width="87%" align="right"><label>
            <input name="title" type="text" class="rightText" id="title">
          </label></td>
          <td width="13%" align="right">9FH'F 'D.(1</td>
        </tr>
        <tr>
          <td align="right"><textarea name="elm1" cols="50" rows="10" id="elm1" style="direction:rtl" >
              </textarea></td>
          <td align="right">*A'5JD 'D.(1</td>
        </tr>
        <tr>
          <td align="right"><label>
            <input type="file" name="filename" id="filename">
          </label></td>
          <td align="right">5H1)</td>
        </tr>
        <tr>
          <td align="right"><label>
            <input onClick="submit()" name="addBTN" type="button" class="btn" id="addBTN" value="  '6'A) .(1 ">
          </label></td>
          <td align="right"> </td>
        </tr>
      </table>
    </form>
    <!-- TinyMCE -->
    <script type="text/javascript" src="jscripts/tiny_mce/tiny_mce.js"></script>
    <script type="text/javascript">
            tinyMCE.init({
                    mode : "textareas",
                    theme : "simple",
                    directionality : "rtl"
    </script>
    <!--end of TinyMCE -->

    the problem is not because of java code insdie jsp page
    I have removed all things but the form and it is still not working
    here is the modified code:
    <!-- add news-->
    <%
    if(request.getParameter("addBTN") != null){
            out.print("addBTN");
    %>
    <!-- end of add news-->
    <form action="" method="post" enctype="multipart/form-data" name="upform" >
      <table width="99%" border="0" align="center" cellpadding="1" cellspacing="1">
        <tr>
          <td colspan="2" align="right" bgcolor="#EAEAEA" class="borderdTable"><p>'6'A) .(1 ,/J/</p></td>
        </tr>
        <tr>
          <td width="87%" align="right"><label>
            <input name="title" type="text" class="rightText" id="title">
          </label></td>
          <td width="13%" align="right">9FH'F 'D.(1</td>
        </tr>
        <tr>
          <td align="right"><textarea name="elm1" cols="50" rows="10" id="elm1" style="direction:rtl" >
              </textarea></td>
          <td align="right">*A'5JD 'D.(1</td>
        </tr>
        <tr>
          <td align="right"><label>
            <input type="file" name="filename" id="filename">
          </label></td>
          <td align="right">5H1)</td>
        </tr>
        <tr>
          <td align="right"><label>
            <input name="addBTN" type="submit" class="btn" id="addBTN" value="  '6'A) .(1 ">
          </label></td>
          <td align="right"> </td>
        </tr>
      </table>
    </form>
    <!-- TinyMCE -->
    <script type="text/javascript" src="jscripts/tiny_mce/tiny_mce.js"></script>
    <script type="text/javascript">
            tinyMCE.init({
                    mode : "textareas",
                    theme : "simple",
                    directionality : "rtl"
    </script>
    <!--end of TinyMCE -->

  • Java code not working in Jsp page....

    I like to say to myself "there is no magic" when I come to a perplexing situation, today is one of those times.
    The following code when executed from the java class retrieves all the specified objects from the database and displays the requested attributes without issue:
    try {
    DBBody dbb = new DBBody();
    Entity[] allbods = dbb.retrieveAll(true);
    for(int k=0;k < allbods.length;k++) {
    Body body = (Body)allbods[k];
    System.out.println("From the dbase index position: " + k +" : " + "\n" + "Id: " + body.getId() + "\n" + "Type: " + body.getType() + "\n" + "Load: " + body.getLoad() + "\n XML:" + body.toXml() + "\n");
    dbb.close();
    } catch (Exception adb) {
    adb.printStackTrace();
    : the **exact same** code as displayed above when run in a Jsp only lists the values for the "body.getId()" and "body.getType()" methods...for a reason I can't discern, "body.getLoad()" and "body.toXml()" return empty strings in the Jsp. Everything else returns as when the code is run from the class. Both "getLoad()" and "toXml()" return strings but behind the scenes use StringBuffer objects that are converted to Strings...getId() returns an int and "getType()" returns a String also, but for whatever reason (to repeat) only those two attributes come through IN THE JSP, in the class ALL attributes are retrieved without a problem...so, what is wrong with Jsp? Java? I get no error message what so ever, just empty strings for the two specified method returns...what am I overlooking. I am running the embedded Jsp engine of the Jetty Http Server that I've incorporated into my application, which uses the latest Jsp version.
    Any help on this issue would be greatly appreciated.

    If you dont want to paste your code, then you will
    certainly not get any responses from the so called
    Java Engineers rest is left to you. We can get dukes
    elsewhere instead.
    SwarajSwaraj, I apologize if I was taken to be abrassive with my last comment, I myself am a java engineer so I have no animosity, as for your request to copy the entire code it is no longer needed I have solved the problem and the solution follows just incase anyone else runs into similar issues. It indeed had nothing to do with StringBuffer working improperly but rather it was how I was getting my dbase connection.
    As many of you who have developed applications with jdbc support to popular dbase vendors may already know, a connection must be established to the database by specifying various parameters, namely the name of the jdbc connection driver classes for the desired vendor (eg. "com.microsoft.jdbc.sqlserver.SQLServerDriver" for MS Sql Server instances) and the driver specific db connection url. Of course the driver classes must be available on the class path so that they can be accessed. Without these parameters the connection will not be initialized..well it turns out my "bug" was caused by my inadvertently ommitting the connection parameters in my Jsp, you might wonder "but you said it executed fine in the jsp except for the missing "getBody()" and "toXml()" results..how could it even execute at all if you didn't establish a connection?"
    The answer is I designed the application to use a default connection driver class (the jdbc odbc bridge driver) and a default connection url (one that is tied to my testing instance of MsSqlServer2000) it turns out that the jdbc odbc bridge is very light weight...it lacks support for certain very useful MsSql datatypes namely "ntext", I use the "ntext" type for fields that can grow to any size (stylesheet code,xml code...etc.) but the bridge driver doesn't support "ntext" BUT rather than throw an exception error like proper error handling would require it silently eats the request (very very bad) ...this exacerbated the problem I had significantly (had it thrown an error I would have known immediately that the connection was using the wrong driver and url and fixed it sooner) as it is ...I was led down blind allies thinking my code was faulty, (which it wasn't strictly speaking ..I was just missing some extra code to account for the possibility that the bridge driver is instantiated by accident) so after adding the following code above the Jsp code shown previously:
    //Configure a connection to a Microsoft Sql Database.
    DBConfig.setVendorId(DBConfig.MSSQL_VID);
    DBConfig.setDBHostId("xiassql");
    DBConfig.setDBHostPort("1433");
    DBConfig.setDBUrl(DBConfig.buildDBUrl());
    :The code worked perfectly. The "DBConfig" class does exactly that..allowing me to pass in connection attributes including the type of vendor "DBConfig.MSSQL_VID", (I have built in support for 5 popular vendors so far), the dbase host name "xiassql" and the port "1433" , then we build the url using the specified attributes and the connection is complete. After adding the code above the Jsp returned all the retrieved values perfectly. So, when testing applications that enable backend dbase connections if you get seemingly identical code behaving differently from class to Jsp, suspect an issue relating to your connection url and classes (assuming you have multiple support and a default value as I do in my app.) also any changes in the execution context from class to Jsp can cause similar errors (like not declaring the same classes at the top of the Jsp file , or less likely using an outdated Jsp engine!)
    Regards,
    PS I will take off the Duke Dollars on this question since I answered it myself!

  • Javascript is not working in JSP

    Hi everybody,
    My javascript is not working in JSP.I m not able to fix this problem.Please tell where the problem in code.
    thx in advance.
    <%@page import="javax.servlet.http.*" %>
    <%@page import="java.sql.*" %>
    <html>
    <head>
    <script type="text/javascript" >
    funtion checkentries()
    if(document.LForm.uname.value==null || document.LForm.upassword.value==null)
    alert("Please fill all entries")
    else
    document.LForm.submit()
    </script>
    </head>
    <body>
    <table width=100% height=100% valign="center" align="center" border=0>
    <tr height=10% ><td>
    <%@ include file="Header.jsp" %>
    <hr>
    </td></tr>
    <tr height=1% width=100%>
    <td align=right>Register
    <hr>
    </td>
    </tr>
    <tr height=77% width=100% ><td>
    <table>
    <tr><td width=65%>
    </td>
    <td bgcolor="black" width="1" ></td>
    <td align="right" valign="top" >
    <form method="POST" action="/EIS/Home.do" name="LForm">
    User Name: <input type="text" align=right name="uname"><br>
    Password: &nbsp&nbsp&nbsp<input type="password" name="upassword"><br>
    <input type="submit" name="submit" value="Submit" onclick="checkentries()">
    </td>
    </tr>
    </table>
    </td></tr>
    <tr height=10% ><td>
    <hr>
    <%@ include file="Footer.jsp" %>
    </td></tr>
    </table>
    </body>
    </html>

    in this part:
    if(document.LForm.uname.value==null || document.LForm.upassword.value==null)should be:
    if(document.LForm.uname.value=="" || document.LForm.upassword.value=="")or
    if(document.LForm.uname.value.length==0 || document.LForm.upassword.value.length==0)

  • BLOB image not shows in JSP page!!

    Hi Dear all,
    I had tried to configure how to show BLOB image to jsp page . The code are works fine and servlet works ok but image can not show only. can you help me that what need to be added. Please help me.
    Can any experts help me? BLOB image not shows in JSP page. I am using ADF11g/DB 10gR2.
    My as Code follows:
    _1. Servlet Config_
        <servlet>
            <servlet-name>images</servlet-name>
            <servlet-class>his.model.ClsImage</servlet-class>
        </servlet>
        <servlet-mapping>
            <servlet-name>images</servlet-name>
            <url-pattern>/render_images</url-pattern>
        </servlet-mapping>
      3. class code
    package his.model;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.util.Iterator;
    import java.util.Map;
    import javax.servlet.ServletConfig;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import oracle.jbo.ApplicationModule;
    import oracle.jbo.Row;
    import oracle.jbo.ViewObject;
    import oracle.jbo.client.Configuration;
    import oracle.jbo.domain.BlobDomain;
    import org.apache.commons.logging.Log;
    import org.apache.commons.logging.LogFactory;
    public class ClsImage extends HttpServlet
      //private static final Log LOG = LogFactory.getLog(ImageServlet.class);
      private static final Log LOG = LogFactory.getLog(ClsImage.class);
      public void init(ServletConfig config)
        throws ServletException
        super.init(config);
      public void doGet(HttpServletRequest request,
                        HttpServletResponse response)
        throws ServletException, IOException
        System.out.println("GET---From servlet============= !!!");
        String appModuleName = "his.model.ModuleAssetMgt";//this.getServletConfig().getInitParameter("ApplicationModuleName");
        String appModuleConfig = "TempModuleAssetMgt";//this.getServletConfig().getInitParameter("ApplicationModuleConfig");
        String voQuery ="select ITEM_IMAGE from MM_ITEMIMAGE where IMAGE_NO = 'P1000000000006'" ;// 'P1000000000006' this.getServletConfig().getInitParameter("ImageViewObjectQuery");
        String mimeType = "jpg";//this.getServletConfig().getInitParameter("gif");
        //?IMAGE_NO='P1000000000006'
        //TODO: throw exception if mandatory parameter not set
        ApplicationModule am =
          Configuration.createRootApplicationModule(appModuleName, appModuleConfig);
          ViewObject vo =  am.createViewObjectFromQueryStmt("TempView2", voQuery);
        Map paramMap = request.getParameterMap();
        Iterator paramValues = paramMap.values().iterator();
        int i=0;
        while (paramValues.hasNext())
          // Only one value for a parameter is expected.
          // TODO: If more then 1 parameter is supplied make sure the value is bound to the right bind  
          // variable in the query! Maybe use named variables instead.
          String[] paramValue = (String[])paramValues.next();
          vo.setWhereClauseParam(i, paramValue[0]);
          i++;
       System.out.println("before run============= !!!");
        // Run the query
        vo.executeQuery();
        // Get the result (only the first row is taken into account
        System.out.println("after run============= !!!");
        Row product = vo.first();
        //System.out.println("============"+(BlobDomain)product.getAttribute(0));
        BlobDomain image = null;
        // Check if a row has been found
        if (product != null)
          System.out.println("onside product============= !!!");
           // We assume the Blob to be the first a field
           image = (BlobDomain) product.getAttribute(0);
           //System.out.println("onside  run product============= !!!"+image.toString() +"======="+image );
           // Check if there are more fields returned. If so, the second one
           // is considered to hold the mime type
           if ( product.getAttributeCount()> 1 )
              mimeType = (String)product.getAttribute(1);       
        else
          //LOG.warn("No row found to get image from !!!");
          LOG.warn("No row found to get image from !!!");
          return;
        System.out.println("Set Image============= !!!");
        // Set the content-type. Only images are taken into account
        response.setContentType("image/"+ mimeType+ "; charset=windows-1252");
        OutputStream os = response.getOutputStream();
        InputStream is = image.getInputStream();
        // copy blob to output
        byte[] buffer = new byte[4096];
        int nread;
        while ((nread = is.read(buffer)) != -1)
          os.write(buffer, 0, nread);
          //System.out.println("Set Image============= loop!!!"+(is.read(buffer)));
        os.close();
        // Remove the temporary viewobject
        vo.remove();
        // Release the appModule
        Configuration.releaseRootApplicationModule(am, false);
    } 3 . Jsp Tag
    <af:image source="/render_images" shortDesc="Item"/>  Thanks.
    zakir
    ====
    Edited by: Zakir Hossain on Apr 23, 2009 11:19 AM

    Hi here is solution,
    later I will put a project for this solution, right now I am really busy with ADF implementation.
    core changes is to solve my problem:
        byte[] buffer = new byte[image.getBufferSize()];
        int nread;
        vo.remove();
        while ((nread = is.read(buffer)) != -1) {
          os.write(buffer);
        }All code as below:
    Servlet Code*
      public void doGet(HttpServletRequest request,
                        HttpServletResponse response) throws ServletException,
                                                             IOException {
        String appModuleName =
          "his.model.ModuleAssetMgt";
        String appModuleConfig =
          "TempModuleAssetMgt";
      String imgno = request.getParameter("imgno");
        if (imgno == null || imgno.equals(""))
          return;
        String voQuery =
          "select ITEM_IMAGE from MM_ITEMIMAGE where IMAGE_NO = '" + imgno + "'";
        String mimeType = "gif";
        ApplicationModule am =
          Configuration.createRootApplicationModule(appModuleName,
                                                    appModuleConfig);
        am.clearVOCaches("TempView2", true);
        ViewObject vo = null;
        String s;
          vo = am.createViewObjectFromQueryStmt("TempView2", voQuery);
        // Run the query
        vo.executeQuery();
        // Get the result (only the first row is taken into account
        Row product = vo.first();
        BlobDomain image = null;
        // Check if a row has been found
        if (product != null) {
          // We assume the Blob to be the first a field
          image = (BlobDomain)product.getAttribute(0);
          // Check if there are more fields returned. If so, the second one
          // is considered to hold the mime type
          if (product.getAttributeCount() > 1) {
            mimeType = (String)product.getAttribute(1);
        } else {
          LOG.warn("No row found to get image from !!!");
          return;
        // Set the content-type. Only images are taken into account
        response.setContentType("image/" + mimeType);
        OutputStream os = response.getOutputStream();
        InputStream is = image.getInputStream();
        // copy blob to output
        byte[] buffer = new byte[image.getBufferSize()];
        int nread;
        vo.remove();
        while ((nread = is.read(buffer)) != -1) {
          os.write(buffer);
        is.close();
        os.close();
        // Release the appModule
    Configuration.releaseRootApplicationModule(am, true);
    }Jsp Tag
    <h:graphicImage url="/render_images?imgno=#{bindings.ImageNo.inputValue}"
                                                        height="168" width="224"/>

  • I wanted to send a push notification, unfortunately it does not work. The page will not load. Anyone know why?

    I wanted to send a push notification, unfortunately it does not work. The page will not load. Anyone know why?

    Push notifications, I believe, is only for iOS.
    If it is for iOS, take a look at Using Apple push notifications with Digital Publishing Suite | Adobe Developer Connection

  • UIComponent broadCastAction is not working in mobile page

    We are using the broadCastAction in one of our critical flows to submit to an action in Managed bean but we are facing issue in our ADF fusion web app for mobile . When we create a page with mobile render option selected the broadCastAction is not getting triggered . broadCastAction shows null in the getter of BroadCastAction.
    <tr:commandButton text="AutoSubmit" id="cb2"
    action="processResponse"
    binding="#{pageFlowScope.testBean.braodCastAction}"
    rendered="false"/>
    This is working in normal page without "render in mobile" selected , we need a solution for it to work on mobile compatible page as well

    Hi Frank
    UIComponent braodCastAction is from javax.faces.component.UIComponent . It is used to invoke action of a UI component through Java code
    if we have button like
    <tr:commandButton text="AutoSubmit" id="testCommandbtn" action="processMobile"
    binding="#{pageFlowScope.mobileBean.braodCastAction}"
    rendered="true" />
    Then through getter method of broadcastAction we can invoke the action of this button using the below code
    braodCastAction.broadcast(new ActionEvent(braodCastAction));
    This is working in the normal jspx page but not working in a page where we select render in mobile

  • When iam using jdownloader for dowload, the firefox did not work at any page, as like there in no internet conexion?

    When iam using jdownloader for dowload, the firefox did not work at any page, as like`` there in no internet conexion?``

    you need to check whether '''jdownloader''' is compatible with the Firefox version you are using.
    -> Tap ALT key or press F10 to show the Menu Bar
    -> go to Tools Menu -> Add-ons -> Extension section -> check the Status of '''jdownloader''' extension -> if '''an update''' is available for this add-on then install the update -> Restart Firefox and check again check the compatibility -> if it is '''GREYED with Exclamation mark''' then it is incompatible with Firefox
    Try using this extension to force compatibility.
    https://addons.mozilla.org/en-US/firefox/addon/add-on-compatibility-reporter/
    Check and tell if its working.

  • ScriptLink tag not working for application page sharepoint 2010

    <ScriptLink> tag not working for application page sharepoint 2010 for including javascript in application page, it appends either 1033 or _layout to path specified for javascript.But javascripts are located in custom document library on site and not
    in _layouts folder.
    Please help and explain in details as I tried lot on this.

    Hi,
    Use the following line of code
    <SharePoint:Scriptlink runat="server" Name="~sitecollection/Style Library/[YOUR SITE]/js/functions.js" Language="javascript" />
    Thanks,
    Vivek
    Please vote or mark your question answered, if my reply helps you

  • Creating a link to text file in a tomcat server not working in JSP webapp

    I am using netbeans to create an web application within my desktop, and then I load the build/web folder to a tomcat server to test the application. Everything works fine. However, when I try to link up my JSP pages to text files (.txt) create by the application on the server, I seem to be getting files that might be kept in a terminal.
    When I get the Real path of the servlet context, I find that it is to a C:\ type file rather than a //hostname type of directory. So obviously those files are not being reached.
    Does anybody know how to deal this problem?

    There are a number of ways to get to the Flash Global Security settings dialog.
    My favourite way is just to double click on a Captivate SWF (not the HTM file) to open it in a web browser, then right click on the playing screen to get the Flash context menu.  On the context menu, click the Global Settings option.
    In the web page that opens, click the link on the left to Global Security Settings.
    Add the folder or drive location of your published Captivate content to the Trusted Locations.

  • Filter does not work with *.jsp URL pattern???

    Hi All,
    I am, by no means, very good at JSF or Java. I have looked at various forum posts on here for ways to implement a security filter to intercept requests to pages that first require one to be logged in, and if not, redirect them to the login page. Yes, I know a lot of you have heard this many times before, and I'm sorry to bring it up again.
    BUT, from the guidance of other posts, I have got a filter that works fine when the url pattern is set to "/faces/*" or "/<anything>/*", however it won't work for "*.jsp" or "*.<anything>"
    My filter is as follows:
    package test.security;
    import javax.faces.context.FacesContext;
    import javax.servlet.Filter;
    import javax.servlet.FilterChain;
    import javax.servlet.FilterConfig;
    import javax.servlet.http.HttpSession;
    import javax.servlet.ServletRequest;
    import javax.servlet.ServletResponse;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    public class SecurityFilter implements Filter{
        /** Creates a new instance of SecurityFilter */
        private final static String FILTER_APPLIED = "_security_filter_applied";
        public SecurityFilter() {
        public void init(FilterConfig filterConfig) {
        public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws java.io.IOException, ServletException{
            HttpServletRequest req = (HttpServletRequest)request;
            HttpServletResponse res = (HttpServletResponse)response;
            HttpSession session = req.getSession();
            String requestedPage = req.getPathTranslated();
            String user=null;
            if(request.getAttribute(FILTER_APPLIED) == null) {
                //check if the page requested is the login page or register page
                if((!requestedPage.endsWith("Page1.jsp")) /* This is the login page */
                    //set the FILTER_APPLIED attribute to true
                    request.setAttribute(FILTER_APPLIED, Boolean.TRUE);
                    //Check that the session bean is not null and get the session bean property username.
                    if(((test.SessionBean1)session.getAttribute("SessionBean1"))!=null) {
                        user = ((test.SessionBean1)session.getAttribute("SessionBean1")).getUsername();
                    if((user==null)||(user.equals(""))) {
                       // try {
                     //       FacesContext.getCurrentInstance().getExternalContext().redirect("Page1.jsp");
                      //  } catch (ServletException ex) {
                      //      log("Error Description", ex);
                        res.sendRedirect("../Page1.jsp");
                        return;
            //deliver request to next filter
            chain.doFilter(request, response);
        public void destroy(){
    }My web.xml declaration for the filter is:
    <filter>
      <description>Filter to check whether user is logged in.</description>
      <filter-name>SecurityFilter</filter-name>
      <filter-class>test.security</filter-class>
    </filter>
    <filter-mapping>
      <filter-name>SecurityFilter</filter-name>
      <servlet-name>Faces Servlet</servlet-name>
    </filter-mapping>
    Note: I have also tried this with <url-pattern>*.jsp</url-pattern> for the filter mapping in place of the Faces Servlet
    My web.xml declaration for the url pattern is:
    <servlet-mapping>
      <servlet-name>Faces Servlet</servlet-name>
      <url-pattern>*.jsp</url-pattern>
    </servlet-mapping>Which JSC/NetbeansVWP automatically creates a "JSCreator_index.jsp" which has:
    <?xml version="1.0" encoding="UTF-8"?>
    <jsp:root  version="1.2" xmlns:jsp="http://java.sun.com/JSP/Page">
      <jsp:forward page="Page1.jsp"/>
    </jsp:root>When run, this causes an Error 500 in the browser and a NullPointerException in SecurityFilter.java on the line:
    if((!requestedPage.endsWith("Page1.jsp")) /* This is the login page */I think I'm missing something that would be obvious to anyone who knows better than me. Any ideas?

    Dear Ginger and Boris,
    thanks for the information - the problem seems to ocur in EP7 as well, Boris told me it is fixed in SP15. We are on SP14 now, so there is hope !
    actually the information in the oss note stated above is also true, as we have an Oracle DB. On a similar demo system (only difference is SQL DB) the hyphen search works !
    best regards, thank you !
    Johannes

  • Bean not working in jsp

    OK, maybe I'm oversharing, but I want to be thorough. Note I asked this question a different way using very different code.
    Here's my jsp file - myq.jsp
    <%@ page language="java" import="java.util.*,com.serco.inquire.*" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <%@ taglib prefix="inq" tagdir="/WEB-INF/tags" %>
    <inq:displayCollection>
    <jsp:attribute name="mgr">Chris Novish</jsp:attribute>
    </inq:displayCollection>Here's displayCollection.tag used by that jsp:
    <%@ tag body-content="scriptless" import="com.serco.inquire.*" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <%@ attribute name="mgr" required="true" %>
    <jsp:useBean id="irc" scope="session" class="com.serco.inquire.IrCollection">
      <jsp:setProperty name="irc" property="mgrid" value="${mgr}" />
    </jsp:useBean>
    ${irc.size} | ${irc.mgrid}Here's the java class IrCollection (used as a bean in the tag):
    package com.serco.inquire;
    import java.sql.*;
    import java.util.*;
    public class IrCollection {
         public ArrayList iRecords = new ArrayList<InquireRecord>();
         public int size;
         public String mgrid;
         public irCollection() {
              super();
         public void populateCollection() {
              try {
                   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                   String filename = "inquire.mdb";
                   String database = "jdbc:odbc:Driver={Microsof Access Driver (*.mdb)};DBQ=";
                   database+= filename.trim() + ";DriverID=22;READONLY=true}";
                   Connection con = DriverManager.getConnection( database ,"","");
                   Statement s = con.createStatement();
                   s.execute ("SELECT * FROM inquiries WHERE manager = '" + this.mgrid + "'");
                   ResultSet rs = s.getResultSet();
                   int cur;
                   while (rs.next()) {
                        cur = rs.getRow()-1;
                        InquireRecord localIR = new InquireRecord();
                        int curID = rs.getInt("ID");
                        localIR.setID(curID);
                        String cursub = rs.getString("submitter");
                        localIR.setSubmitter(cursub);
                        this.iRecords.add(cur, localIR);
                   con.close();
                   this.size = iRecords.size();
              catch (Throwable e) {
                   System.out.println(e);
         public int getSize () {
              return this.size;
         public void setMgrid(String datum) {
              this.mgrid = datum;
              this.populateCollection();
         public String getMgrid() {
              return this.mgrid;
    }and here's the InquireRecord java class used by IrCollection:
    package com.serco.inquire;
    public class InquireRecord {
         private int ID;
         private String submitter;
         public InquireRecord() {
              super();
         public InquireRecord(String asubmitter) {
              this.submitter = asubmitter;
         public int getID(){
              return this.ID;
         public void setID(int datum) {
              this.ID = datum;
         public String getSubmitter() {
              return this.submitter;
         public void setSubmitter(String datum) {
              this.submitter = datum;
    }The JSP does this: set the mgr variable, which is passes to the tag, the tag then creates an instance of IrCollection using that mgr variable. (Yes, putting that populateCollection() method call in the setMgrid() method is probably Bad Practice, but it works, usually). The IrCollection objects builds an ArrayList of InquireCollection objects from an Access database. It then sets it's size property based on how many InquireCollection instances it put into the ArrayList. Once that's all done, the tag spits out 2 things: The size property and the mgrid property.
    When I view the JSP, it gives me 0 for the size and Chris Novish for the mgrid.
    I think this could be one of the following:
    *Not finding any matching records of the database
    *Not actually executing the populateCollection() method
    *some how forgetting the information it put into that ArrayList?
    I"m sure there's another possibility, but I don't know.
    Here's what gets me. Here's a test class I made called TestCollection:
    {code}package com.serco.inquire;
    import java.util.*;
    import java.text.*;
    public class TestCollection {
         public static void main(String[] args) {
              IrCollection myCollection = new IrCollection();
              myCollection.setMgrid("Chris Novish");
              System.out.println(myCollection.getSize());
              System.out.println(myCollection.getMgrid());
    }{code}
    if I run that I get a size of 4 and a mgrid of Chris Novish.
    Same data in, and it works as expected.
    So... why won't JSP do it?

    You have defined a session scope for that bean. You have to make sure that the bean is instantiated by this jsp and not earlier. If the bean is located in the session because it was set earlier, then the body tags within useBean are not evaluated.
    Look here - http://java.sun.com/products/jsp/tags/syntaxref.fm14.html#8865
    An easy way to test it would be to change the scope of the bean to request.
    ram.

  • Java script not working in JSP.

    Hi everyone
    I've got a problem with a java scipt that's not doing what I want it to do.
    I have a jsp which gets data from a database to display.
    On the jsp there is a "add" button which on click will open another jsp to add a contact, when I add the contact the jsp calls a web servlet which adds the contact to the database.
    After the contact is added the servlet directs the page back to the contacts page, and it must display the newly added contact in the jsp.
    I've configured a script that checks if there is a attribute called "addContact", if it has a value of "added" it must reload the page on load, which in turn will display the newly added contact, it refreshes but it doesn't display the newly added contact, it worked but after awhile it stopped working.
    Beneath is my code for the contact list jsp and the servlet.
    ContactList.jsp
    <?xml version="1.0"?>
    <%@ page import="contacts.Contacts"%>
    <%@ page import="java.util.*"%>
    <jsp:useBean id = "contactsData" scope = "page" class ="contacts.ContactsData"/>
    <html>
         <head>
              <title>Contact List</title>
              <script language=JavaScript>
              <!--
                   function clicked(clickedValue)
                        if(clickedValue == "add")
                             window.location = "AddContact.jsp";
              -->
              </script>
         </head>
              <%
              String refreshSession = (String)session.getAttribute("addContact");
              if(refreshSession != null && refreshSession.equals("added"))
              %>
              <body onload="window.location.reload(true);">
              <%
              session.removeAttribute("addContact");
              else
              %>
              <body>
              <%
              %>
              <h1>Contacts</h1>
              <form>
                   <table cellpadding="5">
                        <%
                             ArrayList contactList = contactsData.getContacts();
                             Iterator contactsIterator = contactList.iterator();
                             Contacts contacts;
                             while(contactsIterator.hasNext())
                                  contacts = (Contacts) contactsIterator.next();
                                  String contactName = contacts.getContactName();
                        %>
                                  <tr>
                                       <td><input type="radio" name="deleteContact" value=<%=contactName%>></td>
                                       <td><a href = "UpdateContact.jsp?paramName=<%=contactName%>"><%=contactName%></a></td>
                                       <td><%=contacts.getCompany()%></td>
                                       <td><%=contacts.getWorkNumber()%></td>
                                       <td><a href = "mailto:<%=contacts.getEmail() %>"><%=contacts.getEmail() %></a>
                                  </tr>
                        <%
                        %>
                   </table>
                        <br>
                        <input type="button" value="Add" onClick="clicked('add')"/>
              </form>
         </body>
    </html>NewContactServlet.java
    package contacts;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import contacts.*;
    public class NewContactServlet extends HttpServlet
         public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
              res.setHeader("Expires", "Tues, 01 Jan 1980 00:00:00 GMT"); //no cache allowed
              HttpSession session = req.getSession(true); //get current session
              String contactssession = (String)session.getAttribute("contactsSession");
              if(contactssession.equals("add"))
                   Contacts contacts = new Contacts();
                   ContactsData contactsData = new ContactsData();
                   contacts.setContactName(req.getParameter("contactName"));
                   contacts.setCompany(req.getParameter("companyName"));
                   contacts.setWorkNumber(req.getParameter("workNum"));
                   contacts.setCellNumber(req.getParameter("cellNum"));
                   contacts.setFaxNumber(req.getParameter("faxNum"));
                   contacts.setEmail(req.getParameter("email"));
                   contacts.setCountry(req.getParameter("country"));
                   contactsData.addContact(contacts);
              else if(contactssession.equals("add"))
              session.setAttribute("addContact","added");
              res.sendRedirect("ContactList.jsp");
    }

    Ren2407 wrote:
    Hi stevejluke
    Thanks for the reply.
    ContactsData stores the Contacts into a database, Access to be precise.
    The store of the Contacts works fine and it gets redirected to the ContactsList.jsp page, but I need to click refresh on the browser to see the new
    contact. I've tried to make it load automatically when the browser opens but it wouldn't, it worked before.
    I'm using Apache to host the webpage.I don't see any errors.So lemme get this straight:
    You have the contactsList.jsp which when Add is clicked you go to addContact.jsp in the same window. Then when addContact is submitted it goes to the neContact servlet which adds the contact to the database and then sends a redirect back to the contactsList.jsp.
    When contactsList.jsp is re-shown it doesn't display the new data so you are using javascript to force-refresh the page, which used to work, but doesn't anymore.
    My guess is that your browser or some proxy between your browser and server is caching the page. You have to tell all clients not to cache that page using META tags:
    <?xml version="1.0"?>
    <%@ page import="contacts.Contacts"%>
    <%@ page import="java.util.*"%>
    <jsp:useBean id = "contactsData" scope = "page" class ="contacts.ContactsData"/>
    <html>
         <head>
              <title>Contact List</title>
                    <meta HTTP-EQUIV="expires" CONTENT="0" />
                    <meta HTTP-EQUIV="Pragma" CONTENT="no-cache" />
                    <meta HTTP-EQUIV="Cache-Control" CONTENT="no-cache" /> You could then get rid of your javascript refresh code altogether.
    p.s. I am a big fan of using JSTL. Try to get rid of all your scriptlets and replace it with JSTL. It would look something like this:
              <h1>Contacts</h1>
              <form>
                   <table cellpadding="5">
                        <c:forEach var="contact" items="${contactsData.contacts}">
                                  <tr>
                                       <td><input type="radio" name="deleteContact" value="${contact.name}"></td>
                                       <td><a href = "UpdateContact.jsp?paramName=${contact.name}">${contact.name}</a></td>
                                       <td>${contact.company}</td>
                                       <td>${contact.workNumber}</td>
                                       <td><a href = "mailto:${contact.email}">${contact.email}</a>
                                  </tr>
                        </c:forEach>
                   </table>
                        <br>
                        <input type="button" value="Add" onClick="clicked('add')"/>
              </form>

  • Greek language not displaying in jsp page

    My application is based on struts framework...
    we doing in multilanguage.
    When i select greek the followingis displayed:
    �������&#132;�&#131;���&#133;���� ���&#128;�����&#137; �&#131;�&#132;��
    even i've did the pageEncoding code in jsp page...
    i dont know why it is not displaying but i maintaining properties files for greek language. so, when i call the greek language, the greek properties file was located and display the content... But for other languages like dutch, portuguese, spanish is working fine...I keep the resource properties file in the same place where other language files placed.
    Is there any more changes i want to do...
    I call this greek lang. externally but should this related to database(SQL Server 2000).
    What i want to do.

    <body background="pic/love.gif">
    <%
    --- jsp code
    out.println("<img src='pic/vijay.jpg' height='100' width='100'>");
    --- jsp code
    %>
    </body>

Maybe you are looking for

  • I'm trying to install the Windows Phone 8.1 Preview for Developers but it won't install. I get x80188308. (I've tried 5 times)

    I want to install a windows phone app I've created via AppStudio, and apparently a prerequisite is to install the Preview for Developers.   However, it won't install. I get 0x80188308. (I've tried 5 times) My Phone info: NOKIA Lumia 920 OS version 8.

  • How to do clean install lion on new macbook pro?

    I have a new macbook pro...I want to do a clean install on a new hard drive...but when I goto the app store it shows lion app available but it's not free?  Do I need to buy this when i just purchased the Mac?  Confused about how that works...in the "

  • Macbook pro screen replacing - cost

    Hello, perhaps someone can help... I need to change my Macbook pro 13" screen but i cannot find the product online. Do they sell just the screen? or i must take the whole computer and leave it there so that they replace it ? Any idea how much the scr

  • Importing a script

    I'm trying to import a script (originally written in Final Draft and exported from there as a PDF) into Story so that I can get at the metadata. I've tried it as a pdf, and exported the pdf as a Word document (both doc and docx) and tried to import t

  • Installing Forms 6i R2 onto Windows Server 2003

    Hi, I have been searching for an answer to this question for a while now, but with no luck: I have a production system (one Windows 2000 server) with the following installed: Oracle 8.1.7.4 Database Oracle 9iAS including Forms and Reports Servers The