Cannot pass content to JSP in JSPDynpro

Hi everyone:
I have an issue. I use nw developer studio wizard to create a JSPDynpro. But it seems JSP cannot get bean's value by useBean tag. Please give me some advice. I will reward the reply. thanks
The source is below:
package Exercise2;
import Exercise2.AddressBean;
import com.sapportals.htmlb.*;
import com.sapportals.htmlb.enum.*;
import com.sapportals.htmlb.event.*;
import com.sapportals.htmlb.page.*;
import com.sapportals.portal.htmlb.page.*;
import com.sapportals.portal.prt.component.*;
public class addresslist extends PageProcessorComponent {
  public DynPage getPage(){
    return new addresslistDynPage();
  public static class addresslistDynPage extends JSPDynPage{
    private AddressBean addrBean = null;
    public void doInitialization(){
      IPortalComponentProfile profile = ((IPortalComponentRequest)getRequest()).getComponentContext().getProfile();
      Object o = profile.getValue("addrBean");
      if(o==null || !(o instanceof AddressBean)){
        addrBean = new AddressBean();
        profile.putValue("addrBean",addrBean);
      } else {
          addrBean = (AddressBean) o;
      // fill your bean with data here...
      addrBean.setLocation("Home");
    public void doProcessAfterInput() throws PageException {
    public void doProcessBeforeOutput() throws PageException {
      this.setJspName("chooselocation.jsp");
Bean:
package Exercise2;
import java.io.Serializable;
public class AddressBean implements Serializable {
     public String location;
@return
     public String getLocation()
          return location;
@param string
     public void setLocation(String string)
          location = string;
JSP:
<%@ taglib uri="tagLib" prefix="hbj" %>
<jsp:useBean id="addrBean" scope="application" class="Exercise2.AddressBean" />
<hbj:content id="myContext" >
  <hbj:page title="PageTitle">
   <hbj:form id="myFormId" >
      <hbj:textView id="Location" text="<%=addrBean.getLocation()%>"/>
   </hbj:form>
  </hbj:page>
</hbj:content>
portalapp.xml:
<?xml version="1.0" encoding="utf-8"?>
<application>
  <application-config>
    <property name="PrivateSharingReference" value="com.sap.portal.htmlb"/>
  </application-config>
  <components>
    <component name="addresslist">
      <component-config>
        <property name="ClassName" value="Exercise2.addresslist"/>
        <property name="ComponentType" value="jspnative"/>
        <property name="JSP" value="pagelet/chooselocation.jsp"/>
      </component-config>
      <component-profile>
     <property name="tagLib" value="/SERVICE/htmlb/taglib/htmlb.tld"/>
      </component-profile>
    </component>
  </components>
  <services/>
</application>

Hi.
U need to remove the following line from the portalapps.xml .
<property name="ComponentType" value="jspnative"/>
<property name="JSP" value="pagelet/chooselocation.jsp"/>
I think now u r problem will
be solved .... as using the above
line the page on submisson didn't
move to the controller <b>"addresslist"</b>
and it was directed to the jsp page.
And therfore on the romoving the above
line from the portal apps.xml will
direct the page on submission
to the controller.
If the suggestion is helpful please reward with points.
Thanks
ritu
Message was edited by:
        Ritushree Saha

Similar Messages

  • The javascript makes the input field to be null and cannot pass variable to

    Hi
    I use the following code to check whether the upload file is in the right format extension.
    However, once I use it and it cannot pass the variable to servlet and throw nullpointerexception.
    How can I fix it?
    <script language="JavaScript">
        extArray = new Array(".jpg", ".png", ".gif");
        function LimitAttach(form, file) {
        allowSubmit = false;
        if (!file) return;
        while (file.indexOf("\\") != -1)
        file = file.slice(file.indexOf("\\") + 1);
        ext = file.slice(file.indexOf(".")).toLowerCase();
        for (var i = 0; i < extArray.length; i++) {
        if (extArray[i] == ext) { allowSubmit = true; break; }
        if (allowSubmit) return true;
        else
        alert("Please only upload files that end in types:  "
        + (extArray.join("  ")) + "\nPlease select a new "
        + "file to upload and submit again.");
        return false;
    </script>
    OnSubmit="return LimitAttach(this.form, this.form.myimage.value)"
    servlet:
    boolean isMultipart = ServletFileUpload.isMultipartContent(request);

    the js works fine, just add id=myimage and it is ok
    checking file type for uploading only image on client side

  • Passing contents of text file in oracle cursor

    Hi,
    I need to pass the content of text file in cursor and pass it on to calling codes. then calling codes will generate another text at their end. Can some help how can I pass contents of text file in oracle cursor? Thanks

    i need to do it without tables for some reasons.

  • I cannot pass information from my Mac to my external hard drive, what can I do?

    Hello,
    This is my first Mac and I am new to all of it. I have an external hard drive that I use to use with my old PC . On the external hard drive box it says its compatible with both windows and Max os x. I can pass files from my external hard drive to Mac but I cannot pass files from my MacBook Air to my external hard drive. No messages comes up or anything explain why it simply doesnt allow me to do so. What can I do?

    Your hard drive is formatted NTFS for windows.  That format is read-only from OSx.  If it's not needed on Windows anymore, you can use Disk Utility and format it for the Mac.   Mac OS extended (Journaled)  - Partition Map scheme of GUID Partition table.
    Make sure to save any data from the drive as it will be wipped doing the above.

  • Error message on Itunes. Cannot read contents of Ipod....

    I forgot to eject my sons Ipod touch before I unplugged it from the USB. Nowwhen I plug it in it tells me itunes cannot read contents of ipod must restore to factory settings.. Please help?! I've tried restarting my computer and Ipod. I've updated Itunes. I used a different cord and I went into settings and reset everything. I'm affraid to restore th Ipod because he has bought games that I don't want him to loose.... Any suggestions?

    That happens when you do not eject the iPod and the iPod is syncing.or upddating.
    Connect the iOS device to your computer and restore via iTunes. Place the iOS device in Recovery Mode if necessary to allow the restore.
    If recovery mode does not work try DFU mode.
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
    For how to restore:
    iTunes: Restoring iOS software
    To restore from backup see:
    iOS: How to back up
    If you restore from iCloud backup the apps will be automatically downloaded. If you restore from iTunes backup the apps and music have to be in the iTunes library since synced media like apps and music are not included in the backup of the iOS device that iTunes makes.
    You can redownload iTunes purchases by:
    Downloading past purchases from the App Store, iBookstore, and iTunes Store

  • Passing value from JSP to JApplet

    Hello,
    I am stuck up with a problem, can anyone please tell me how do i pass a value from a JSP page
    to a JApplet,
    and the parameter passed through JSP should be displaed in the JTextArea.
    It would be kindful if any of you could help.
    Thanks
    Sanam

    hello,
    thanks for reply.
    I know how to pass parameters from html,
    I want to pass values from jsp page,
    and i dono how to do it, may be we cann pass values through url connection but i dono how.
    if anone knows plz help me in solving this.
    i hvae posted my applet code.
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.JToolBar;
    import javax.swing.JButton;
    import javax.swing.ImageIcon;
    import javax.swing.JFrame;
    import javax.swing.JTextArea;
    import javax.swing.JScrollPane;
    import javax.swing.JPanel;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.net.*;
    import java.sql.*;
    <applet code = "DocApplet" width = 500 height =5000>
    </applet>
    public class DocApplet extends JApplet
         private JPanel jp;
         private Container cp;
         private JTextArea jt;
         private JToolBar tb;     
         private JScrollPane sp;
         private String annotation;
         private String url;
         private Connection con;
         private Statement stmt;
         public void init()
              jp = new JPanel();
              cp = getContentPane();
              jt = new JTextArea();
              tb = new JToolBar();
              sp = new JScrollPane(jt);
              repaint();
         public void start()
              jp.setLayout(new BorderLayout());
              jp.add(tb, BorderLayout.NORTH);
              jp.add(sp, BorderLayout.CENTER);
              jt.setBackground(Color.BLACK);
              jt.setForeground(Color.WHITE);
              setContentPane(jp);
              addButtons(tb);
              repaint();
         public void run()
              repaint();
         public void paint()
         private void addButtons(JToolBar tb)
              JButton button = null;
              button = new JButton("Save");
              button.addActionListener(new ActionListener()
                   public void actionPerformed(ActionEvent e)
              tb.add(button);
    }

  • Itunes cannot read contents of the ipod.  go to summary tab in ipod preferences and click restore to restore to factory settings

    I plugged in my ipod to install the latest version of itunes on my computer and I got this message:  "itunes cannot read contents of the ipod.  go to summary tab in ipod preferences and click restore to restore to factory settings".  I can't get rid of it and now have zero songs on my ipod but all of my songs are in my library.  Help, please.

    Sorry, my mistake, the nano has a flash-based drive so most of that post won't apply, although you might see if the DFU restore section works.
    Try also suggestions from iPod nano: Error message saying that iPod 'could not be identified properly'
    tt2

  • Ipad2 sd movie cannot open content not authorized

    Downloaded SD movie onto ipad2 and it will not open to play. Get the message Cannot Open: Content not authorized. Using current version of OS, other SD movies in library play fine.

    Was the download complete? Did you stop halfway through the download of the movie?
    If you did, that could affect the issue.
    Zach

  • I cannot access Content Library in iMovie - Content Library doesn't show on the iMovie screen and is greyed out when accessed through "windows" tab at the top. Also unable to update the projects/events (a suggested solution for a similar question).

    I cannot access Content Library in iMovie - Content Library doesn't show on the iMovie screen and is greyed out when accessed through "windows" tab at the top. Also unable to update the projects/events (a suggested solution for a similar question). I haven't had this issue before, I have always used the content library on the screen but haven't used this for about a month. How can I make the Content Library available?

    Thanks so much! I am backing up the entire computer now with an external hard drive - this should be fine right? And surely if I am backing up the whole computer these projects/videos will be backed up too? I wasn't sure how to do this any other way and I am clearly not great with tech issues. Once this is done and I am sure my projects/videos are safe I will do the delete and reinstall bit. Thanks for taking the time to help

  • Some of the newer shows and movies on my IPAD 2 show "cannot open content not authorized"

    All of my library plays on my MAC and Apple TV, but some of the newer shows and movies on my IPAD 2 show "cannot open content not authorized" . If I download them directly to my IPAD they will play. iPad and MAC are all up to date. I have restarted the IPAD 2 and MAC multiple times.

    I have the opposite issue. I play my tv shows and movies on itunes off my computer but all I get is the audio. The picture shows up in flashes every couple of times but does not stay on. I have the most recent Itunes (7.6.1)available and am running Windows Vista. Any help available?

  • URGENT: Passing Array from JSP to a Stored Procedure

    Hi,
    Can some one please help me understanding how can I pass array from JSP page to a stored procedure in database.
    Thanks in advance.
    Jatinder

    Thanks.
    I tried ArrayExampla.java and was successful in passing array values to the stored database procedure.
    How can I use this class in JSP? Like I have first JSP where in I will collect input from the user and then submit it to the second JSP - that needs to call the ArrayExample.java to pass the values as array to the database.
    How should I call this java code in my second JSP?
    Thanks in advance.

  • How to display Arabic content in JSP ?

    Hi all,
    I used the following encoding method to display arabic content in JSP page.
    <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
    <meta content="text/html; charset=UTF-8" http-equiv="content-type"/>
    I also set -Dfile encoding=ISO-8859-6 in the JVM Options.As a result the arabic data is getting displayed .
    Variable "data" contains the actual arabic data.
    function updateArabicData(data){
    try{
    document.getElementById('divtag').innerHTML=""+data;
    }catch(err){
    <html>
    <body>
    <div id="divtag" lang="ar-sa"></div>
    </body>
    </html>
    But the problem is the arabic data getting displayed in JSP (within the <div>)seems to be jumbled up.The users say that the arabic words within a single sentence are not arranged correctly.They are mixed up.Please help me with a solution.
    Edited by: Alance on May 27, 2010 5:34 AM

    Data is retrieved as follows
    if(msg.getField("GEN_UNICODE_MESSAGE_1")!=null){
    resultString=resultString+"N"+""+new String((byte[])msg.getField("GEN_UNICODE_MESSAGE_1").value.get(0),"ISO-8859-6");
    with content Type set as response.setContentType("text/html;charset=ISO-8859-6");
    ISO-8859-6 -since the data contains arabic news.
    Edited by: Alance on May 27, 2010 11:05 PM

  • Urgent! pass parameters between jsp pages

    Does anyone can give an example about how to pass parameters between jsp pages?
    This is what I do:
    pageContext.forward("pag_loginc.jsp?p_idusr=" + strUsr + "&c_password=");
    But when deployed is not working.
    Help is needed.

    can you put that stuff in the session context in the first page, then pull it out in the second page?

  • Adobe error: firefox cannot process content of type text/html

    I have designed a PDF form designed in Livecycle designer. The form has a submit button which invokes a servlet. The servlet receives the request and send a response in "text/html UTF-8". If have no browser or IE open when submitting the form, I receive a response that the form has been either successfully submitted or not. However, if I have Firefox open when Submitting, I get an Adobe Reader dialog box that says "An error occurred during the submit process. Cannot process content of type text/html utf-8".
    When I look in the database, the form is successfully submitted. How do I make the adobe pop up to disappear and print the confirmation.

    where you able to fix the problem?
    Viral

  • To put WML Content  in JSP.?

    hi all....i m working with one mobile application ..in that i want to put my wml content in jsp ....can i put all wml content and tag in jsp ......if yes then could u give me sample for that one so it will be appriciate me....
    regards.....

    The only thing you can watch on AppleTV that ISNT in your iTunes library is photos. Everything else must be there.
    I'm not sure why you remove things from iTunes after syncing with your iPod, but that shouldn't be necessary...
    Your media does not have to "live" on your MBPro hard drive to be in your iTunes library. I highly recommend using an external drive to store everything and just use a "home" and "travel" iTunes library if needed to keep things separate. As it is, I use a single iTunes library and manually sync to my iPhone.

Maybe you are looking for

  • Lock ups when gaming

    I was playing World of Warcraft (no apologies) and I had my first lockup since OS 10.x came out. I thought it odd but figured I was due. I hard booted my machine and launched the game again. Less than two minutes later it did it again. I fought with

  • All of a sudden, my 4th gen iPod Touch no longer works with my Apple TV, has Apple "upgraded" something to kill off this older unit? (IOS 6.1.2)

    All of a sudden, my iPod Touch (4th gen, IOS 6.1.6) no longer works with Airplay on my Apple TV.  It was working and still works as a 'remote' but not with Airplay which seems to indicate I've been abandoned by the message that pops up on the screen

  • Broken phone line

    Hi I was wondering how I can report a problem with my mothers phone line.  She came home after yesterday to find that the phone lines on the outside of the house was dangling from the side of the building. My mum doesnt have a an active phone number

  • Status group of bill of exchange

    Hi, I am posting  with a Special G/L Indicator which is a bill of exchange.The problem is that I need to enter the field BUPLA and it does not appear. I see that many fields are from table BSED and the BUPLA exits in the table, but I don not know how

  • Fax from iPhone

    I know there is a huge difference in digital vs. analog phone features, but it would be awesome if either iOS or OS X could send a fax without the need to pay for per use fax service or have a analog phone line. Just a thought.