Where should RequestDispatcher.include() be used ?

Hello again,
I could not get the expected result from RequestDispatcher.include().
First, I cannot use it to include static content; second, it does not include the dynamic contents in proper order.
Now my question is, where can I use RequestDispatcher.include(), or should I use it at all ?
The following are the source files and result on SunOne WebServer6.1 and Tomcat 5.5.12.
IncludeDynamic.jsp
<%@ page import="javax.servlet.RequestDispatcher" %>
<html>
<body>
     <h1>First partition</h1>
     <hr />
     <h2>
<%
     RequestDispatcher rd = application.getRequestDispatcher("/jsp/IncludeHidden.jsp");
     rd.include(request, response);
%>
     </h2>
</body>
</html>
IncludeHidden.jsp
Dynamic Inlcude Content
The following is the HTML I get from the browser,
Dynamic Inlcude Content
<html>
<body>
     <h1>First partition</h1>
     <hr />
     <h2>
     </h2>
</body>
</html>
----------------------------------------------------------------------------------------

Try using
<%@ include file="/jsp/IncludeHidden.jsp" %>
instead of
<% RequestDispatcher rd = application.getRequestDispatcher("/jsp/IncludeHidden.jsp"); rd.include(request, response); %>

Similar Messages

  • Where should i include the copied  payment advice script ?

    Hi experts,
    i  copied script from std script form (F110_IN_AVIS) . I did some modifications ,now i want to include this script name
    (my form name is YPM_F110_IN_AVIS)
    in the program.Where should i include (in f110 or somewhere) my script so that when executing the tcode FCH7
    modified script will be executed.please give me the steps.pls help me in this.

    you got this answer earlier today in another thread of yours....
    TA is FBZP.
    [url]find the payment advice script form name in fch7[url]
    Edited by: Florian Kemmer on Apr 15, 2010 1:20 PM

  • Where should i include my conn.close() command

    Hi,
    My code frequently fetches data from database, so i created a class like this
    public class ConnectToDatabase { /*            public ConnectToDatabase()                 {                                 Connection conn;                 } */ public ResultSet selectS(String userQuery) throws Exception { String userName = "root"; String userPassword = "gal"; String databaseUrl = "jdbc:mysql://localhost:3306/test"; Class.forName ("com.mysql.jdbc.Driver"); Connection conn = DriverManager.getConnection (databaseUrl, userName, userPassword); String query = userQuery; Statement S=conn.createStatement(); ResultSet RS=S.executeQuery(query);                                 //conn.close;    ( "a" ) return RS;                                 //conn.close;    (" b ") } /*              public void closeConnection()                 {                                 conn.close;                 } */ }
    and from the main code i make call as given below (it works fine)
    ConnectToDatabase CTD=new ConnectToDatabase(); ResultSet result=CTD.selectS(String userQuery); //CTD.closeConnection();
    Now my problem is
    1) If try to give "conn.close()" before "return RS;"(marked by "a") It will show error (RS cannot be fetched after closing connectio)
    2) If write conn.close after return it wont be executed (ofcourse - unreachable statement) ( "b" )
    3) If use "CTD.closeConnection();" it gives errror saying that "cannot find conn(in closeConnection()) " i dont know why constructor is not loaded.(rest of commented lines when uncommented)
    Where should i use conn.close statement? I dont want any change in my return type or parameters...

    I used like this
    public class ConnectToDatabase
       Connection conn;
       public ResultSet selectS(String userQuery,String[] userInput,int inputNumber )
           //code to select
       public void closeC()
           conn.close();
    }and from main class
    ConncetToDatabase CTD=new ConnectToDatabase();
    ResultSet RS=CTD.selectS(x,y,z) ;
    CTD.closeC();

  • OnLoad - javascript - where should I include the code?

    Hi, have searched the forum and found that the pleace to include onLoad call should be included in the HTML Body section but when I try to apply the changes I get the error message:
    1 error has occurred
    * You may not declaratively set cursor focus if you specify an ONLOAD in this attribute. You can programatically set cursor focus by using the following syntax:
    onload="mystuff(); first_field();"
    my call is:
    onload="alert('test')";
    Thanks

    Hi,
    Have a look at the Edit Page Attributes for your page. On there is a Cursor Focus setting - make sure this is set to "Do not focus cursor". You can only have one onload for the body tag, so you can't have your javascript and this set to "First item on page"
    Andy

  • I am putting together a proposal for a Final Cut Pro Workstation to use with a tapeless HD camera.  Can anyone suggest the best camera (in the 5-10,000 dollar range) ?  What hardware and software should I include in the package?

    I am putting together a proposal for a Final Cut Pro Workstation to use with a tapeless HD camera.  Can anyone suggest the best camera (in the 5-10,000 dollar range) ?  What hardware and software should I include in the package?

    This is quite an open suggestion, but here are some ideas which might get you started.  There are good HD cameras in your price range from Sony, Panasonic and Canon (and maybe other manufacturers). Tapeless formats vary.  I have only worked with Sony XDCAM which seems pretty good to me.  File sizes for material shot at 35MBS are not too huge and, with the free Sony transfer and conversion programme, are easy to bring into the computer via USB direct from the camera or from a fairly inexpensive converter.  The Sony XDCAM EX3 can produce results well up to broadcast quality.
    As to hardware, you'll need a powerful MAC - iMac, Macbook Pro or MacPro with 4GB or more of RAM and a good video card.  Softwarewise, FCPX is quite a bit cheaper than FC Studio 3 and of course it's 64bit and can make better use of multi-core machines than FCP7.    It's also designed to handle HD formats with less hassle than FCP7 and is matched to the latest versions of Motion and Compressor.   But you'd probably be wise to search reviews of FCPX before you make your choice - it has some issues.
    A good HD monitor will be essential and, for colour correction etc, you may want to consider a second monitor or HD TV foe editing. ( A MacPro is generally the best machine to connect a second monitor to). 
    This should give you a good editing system, but there are many other things you could add (Photoshop, professional sound monitors, etc)
    Hope this helps a bit.
    Jonathan

  • Can i use microsoft office on my macbook pro and from where should i download it?

    can i use microsoft office on my macbook pro and from where should i download it?

    I don't use Office myself so can't really offer advice. I don't recall seeing your issue before. Maybe someone who uses Office will be able to help.
    As this thread is marked as solved it won't get the attention your query warrants. It would be a good idea to start your own thread discussing the problem - I'm sure someone here will offer the right advice/help.
    Make sure you note what Mac your have and what version of OS X you are running.

  • I'm from israel and i need to use my iphone Warranty Where should I send the device?

    hi,
    i'm from israel and i need to use my iphone Warranty Where should I send the device to fix some problem?

    Depends on where the device was purchased.
    If it was purchased in Israel, take it to an authorized service center in Israel.
    If it was purchased elsewhere, you'll need to take it back to the country it was purchased in for support.

  • Where should be the file of database if i use windows version of oracle

    hello
    where should be placed the file of database if i use windows version of oracle ?
    will be there some special partion for dadtabase file ?
    10x

    user10860289 wrote:
    i thin the database shoud has own file
    in interbase this file is name_of_db.gdb
    i seatch for such database file in oracle ? And why would you expect Oracle to have the same file(s) as some other product?
    Oracle implements it's databases with multiple data files, not just one. And that's in addition to all of the various files that make up the software, apart from any databases.
    You definately do not want to put the database files under ORACLE_HOME. If you have any choice at all, I wouldn't even want them on the same partition. A default installation and db creation may try to put them there simply because that is the one directory structure oracle can count on being there. But that is one default that is far from best practice.
    The minimum partition configuration I'd want for a Windows server hosting an Oracle database is ....
    c:\ - operating system only
    d:\ - Oracle home, admin, and one set of all duplexed files (control, redo)
    e:\ - all other database files
    For the 'sandbox' setup on my personal laptop, where I only have a c: drive, I still break it out ...
    c:\oracle\app\product\10.2.0 <-- Oracle Home
    c:\ora1\mysid\ <--- some data files
    c:\ora2\mysid\ <--- some data files
    c:\ora3\mysid\ <--- some data files
    Take a look at this: http://download.oracle.com/docs/html/A97297_01/appg_ofa.htm
    It is out of the 9i docs, and is directed to unix, but if you will read and understand the principles it is a good guide even for Windows. You can also google "optimal flexible architecture" and get lot's of other docs.
    I dare say that at this point It would be a good investment in your career to go to tahiti.oracle.com. Drill down to your product and version. There you will find the complete doc library.
    You should spend a few minutes just getting familiar with what kind of documentation is available there by simply browsing the titles under the "Books" tab.
    Open the Reference Manual and spend a few minutes looking through the table of contents to get familiar with what kind of information is available there. Learning where to look things up in the documentation is time well spent on your career.
    Read the 2-Day DBA manual cover to cover.
    Notice the 'search' function at that site.
    Then set yourself a plan to dig deeper.
    - Read a chapter a day from the Concepts Manual.
    - Look in your alert log and find all the non-default initialization parms listed at instance startup. Then read up on each one of them in the Reference Manual. Take a look at your listener.ora, tnsnames.ora, and sqlnet.ora files, then look up what you see there in the network administrators manual.
    Give a man a fish and he eats for a day. Teach a man to fish and he eats for a lifetime.
    Am I wrong ?

  • I created movie using iMovies on iMac. Sent movie to iTunes on iMac. Transferred movie to iPad in iTunes. I can not find it on iPad. where should I look?

    I created movie using iMovie on iMac. Sent movie to iTunes on iMac. Then sent to iPad using iTunes. I can not find it on iPad. Where should I look? When iPad is connected to iMac it shows it to be in movies. When I look under iTunes movies on iPad I get movies I can rent or buy. when I look under videos I get a blank screen

    Are you looking in the Videos app? iMovie on the iPad? The Photos App? I don't use iMovie but those are the three places where you should look.

  • Where should i visit to get my photos in icloud storage

    where should i visit to get my photos in icloud storage and how can i sync all my camera roll on icloud as backup effectively.

    how can i sync all my camera roll on icloud as backup effectively.
    Backups of your iOS devices will include the Camera Roll: To backup your iOS devices see:
    For backing up to iCloud:   iCloud: Backup and restore overview  http://support.apple.com/kb/PH12519
    For backing up using iTunes:  iTunes: About iOS backups  http://support.apple.com/kb/HT4946
    where should i visit to get my photos in icloud storage
    In addition to Gail's  advice:  Right now only shared photo streams,  journals, and slideshows can be stored in iCloud and published on the web, so you can see them from other devices. But these photos will have a reduced resolution and will not suffice as a backup. These options are only for sharing.
    see this chapter in the iPhoto help on how to share your photos on the web:  http://help.apple.com/iphoto/iphone/2.0/?handbuch#blnk7d8f763e
    publish your journal
    photos as a slideshow
    iCloud Photo Sharing overview

  • How to identify the program in which an enhanncement spot should be included?

    How to identify the program in which an enhanncement spot should be included? For example I want to validate VA02 for USER authorization. So an enhancement spot should be written in program MV45AFZB. How do you identify this program ?

    It depends on where you need to place your modification, the enhancement will be assigned to main program,
    if you need to place in an include used by several program you need to make sure which main program is used by your transaction.
    In the case of MV45AFZB, the main program is SAPMV45A, but it's easy as this include is used only there,
    Max

  • Where should I place my preloaders?

    Hi all,
    Would like to seek advice on where should I place the
    preloaders.
    I have a banner swf, menu swf, main content swf, and intro
    swf. where should i load the preloader? on the main MC that will be
    calling these swf? or each swf have their own preloader? that would
    look rather weird.
    Of should I just merged banner, menu, main content and intro
    altogether? How do i do that? I am lost as to should I separate
    them out or put all eggs in 1 nest. My main content will have
    transitions between each sections.
    since my menu is separate from the main content, how do I
    point them to get the main content to change section whenever user
    click on 1 sections?
    I am so lost. Please advise. Thanks

    Hey X, sorry I haven't responded of late, working elsewhere.
    Let me address some of the questions you've had above.
    1) I'm very sorry, I see that I missed that assignment when I
    typed this out, within the loadFile function the correct call
    should be: mcl.loadClip(src, clip);
    2)the code is AS2, and yes it is legal coding. first, we're
    setting up parameters for our function here, and then we pass them
    this information when we call the method that we've set up, so that
    we can 'feed' information to the function that then uses it to
    perform it's job. the variable declarations in this case here are
    called 'strict typing' (ie. src:String, file:String, ...) and it's
    just a way to define variables of a particular 'type', it isn't
    necessary to follow the variable names with the type declaration,
    but I thought that I would include it here so that it made sense to
    you and so that you could see what type of variables need to be
    passed to the function. the varaibles MUST be passed to the
    function in the order that they are listed.
    3) yes you've got this all right :) The onLoadInit handler
    fires when the loaded clip becomes instantiated on the timeline
    (eg. available), previous to this point you could NOT say something
    like 'clip.gotoAndPlay(10);' because the loading clip was not yet
    available for the call, and it would fail. So you can use this
    handler to tell the loaded clip to 'do something' if you need this
    type of functionality, like say for instance that you need the
    loaded swf to go to a certain 'page' depending on what button the
    user pressed, this handler would be a way for you to pass that
    informtion along, and tell the loaded clip to goto the correct
    position, handy ;)
    As to the last question in 3, I touched on that above, my bad
    4) I was just talking about the name of the swf file being
    called 'dummy'.
    5) No, put everything in frame one, but on a different
    layers. Place your preloader on the top layer, and the 'blank' MCs
    (to load into) on layers below.
    OK, on to your last post.
    Yes, the way it's set up here the preload bar would run to
    100% for each load and then start again for the next one, it also
    has a text instance that tells the use what is being loaded each
    time. This could all be changed, and you can certainly use you own
    preloader instance, however you will need to reconstruct the method
    that is handling the progress. See if you wanted ALL of the
    instance your loading to equal 100% of your loader bars progress
    (for the first load anyway) you can't calculate the total bytes of
    all files previous to initiating the load, so you have a problem
    here. One method might be to 'break up' the load and apportion the
    progress indicator evenly for each item needed in the intital site
    loading. what I mean by that is, if you have 4 items that are
    needed to load, then each item would 'move' the progress bar by
    25%, so that when 100% of the first item is loaded, the progress
    bar is revealed by 25%, then the second load reveals 50%, and so
    on. It will just take a little math to change the code to handle
    the progressions. Now I would suggest that you NOT animate the
    masking rectangle by frames, I would do this with code adjusting
    the _x position of the mask by an amount that has been calculated
    with the loading code. also this method will have to accomidate,
    both multi-loads and singlular loads so you'll need to use another
    parameter to define how the preload indicator progress is 'broken'
    and into how many parts. This would end up in the math that defines
    the system that controls the indicator.
    OK this should be enough for you to think about for now
    :)

  • Where should a ".jar" file be placed?

    Hey.
    I know there's a jar (java archives) forum, but things are kinda slow over there...
    I'm trying to run a simple JDBC application using Cloudscape (I've downloaded cloudscape.jar for that) and jdk1.3.1, on LINUX.
    The new .jar file isn't recognized and I keep getting a runtime ClassNotFoundException.
    I've changed several system-files (such as the root's .tcshrc and my own .bashrc), and copied the file almost everywhere, but just can't get it right :-(
    Where should the cloudscape.jar file go, and what are the exact changes needed in order to force (no more mister nice-guy) the system to acknowledge it?
    Thanx,
    Mike.

    just make sure your CLASSPATH includes cloudscape.jar. Not just the path, but also the jar filename.
    There is also a jre/lib/ext path in your java installation where you can dump your jar file so it will automatically be seen when you run your program.

  • Spotlight problems: where should mdimporters be?

    I see that others are having problems now, too, after the 4.5 upgrade.
    After installing, the Office 11.2.3 upgrade I was having a **** of a time getting my home computer to find Entourage messages through Spotlight. After trying many things, someone helped me by pointing out that the mdimporter plugins should be in the System/Library/Spotlight folder, not the Library/Spotlight folder, voila!
    Now for other applications I noticed the same thing, including Apple apps. So, where should the mdimporter plugins ultimately be? Does this have anything to do with the recent 4.5 upgrade?
    I love the cuss word filter here! 1984 is a bit like 1984, no?
    Thanks in advance.
    iMac G5 17   Mac OS X (10.4.4)  
    iMac G5 17   Mac OS X (10.4.4)  

    Generally speaking the /System/Library is reserved by Apple for Apple's own system level installed goodies. The /Library folder is what should be used by things installed by a user's programs. Thus my /Library/Spotlight folder sports the following program mdimporters:
    AppleWorks.mdimporter
    Keynote.mdimporter
    Microsoft Office.mdimporter
    Pages.mdimporter
    While the /System/Library/Spotlight folder has these:
    Application.mdimporter
    Audio.mdimporter
    Bookmarks.mdimporter
    Chat.mdimporter
    Font.mdimporter
    iCal.mdimporter
    Image.mdimporter
    iPhoto.mdimporter
    Mail.mdimporter
    PDF.mdimporter
    PS.mdimporter
    QuartzComposer.mdimporter
    QuickTime.mdimporter
    RichText.mdimporter
    SystemPrefs.mdimporter
    vCard.mdimporter
    So for program importers think /Library, for Apple's own deeper level ones think /System.
    Francine
    Francine
    Schwieder

  • RequestDispatcher.include causing some problem in Weblogic 9.1?

    I am migrating my application from web7.1. to 9.1.
              In some servlets, i am using the RequestDispatcher.include method to paste a relevant JSP content.
              When I access the servlets parameters values only after the requestDispatcherObject.include(req,res), the parameter values are returned as null.
              For eg.
              consider 2 parameter values , status,mode are present in a servlet, project.java.
              I am including project.jsp file inside this servlet.
              When I access the parameters only after the include statement, the values are returned as null, but when i access any one parameters before this statement, both the original parameter values are retained.
              i.e.
              /Project?status=disp&mode=true
              Inside <b>doGet</b> method of <b>Project .java</b>:
              <b>String mode=HttpServletRequest.getParameter("mode");
              RequestDispatcher reqdis=getServletConfig().getServletContext().getRequestDispatcher("/project.jsp");
              reqdis.include(req,res);
              String status=HttpServletRequest.getParameter("status");
              System.out.println("status "+status+"\nmode "+mode);</b>
              The above code prints the value
              <i>status</i> <b>disp</b>
              <i>mode</i> <b>true</b>
              However when we change the code as ,
              <b>RequestDispatcher reqdis=getServletConfig().getServletContext().getRequestDispatcher("/project.jsp");
              reqdis.include(req,res);
              String status=HttpServletRequest.getParameter("status");
              String mode=HttpServletRequest.getParameter("mode");
              System.out.println("status "+status+"\nmode "+mode);</b>
              the output is
              prints the value
              <i>status</i> <b>null</b>
              <i>mode</i> <b>null</b>
              Thsi problem occurs in weblogic 9.1, and is otherwise working fine in weblogic 7.
              Do I have to make code change in all instances where this problem occurs , or is there any common solution.
              Kindly help me solve this issue at the earliest

    I tried reproducing this, and I don't observe the same behavior. I get the same values (those specified in the URL) regardless of whether I retrieve them before or after the include (or mixed as in your example).
              There is only one way I can think this might happen. If you are using HTTP POST and using getInputStream() or getReader() to read the body of the request, you could affect things. This is mentioned in the servlet spec. This would fit with your behavior. If your servlet reads a parameter, WLS will parse the all the parameters and they stay read-only (you can't set parameters, only attributes). WLS will only parse on demand for performance reasons (no point if one isn't requested). Nothing the included page can do will affect the parameters, so you'd see both be set. If the servlet includes the JSP first and the JSP calls getInputStream() and reads all the data, then when the servlet gets a parameter and WLS attempts to parse the POST body, there is no data left to be read (because the JSP already read it). Thus, everything will be null.
              But, in your example, it appears you are using GET. It shouldn't be possible if the parameters are set as part of the URL. And indeed, I don't see it.
              Perhaps your example is a simplification? What is your include doing?

Maybe you are looking for

  • Changing the File path for SQL Loader Recognition

    I am learning how to create a control file. The names.ctl file was placed in "Names" folder in my "C:\Windows" file. I get the following error when trying to run the script for sqlldr: Sql*Loader-500 Unable to open file. Sql*Loader-553 file not found

  • Conversion of VIs from LabView 2013 to 2011

    Hi, I would be grateful for conversion of zipped VIs from LabView 2013 to 2011. Thank You, Michal Solved! Go to Solution. Attachments: main VIs.zip ‏38 KB

  • Besst way to find a function module

    Hi there I am quiet new to ABAP and I am curiouse about how to best approach the search for a function module?? can u guys please tell me how you search for functions modules that preform a specific task. For example if I search for a function module

  • "Team Ware" and "Workshop Projects"

    I am setting up a new development environment for a group of people using Forte Teamware and Workshop. In the Teamware workspace structure I plan to create one parent workspace for each Workshop project. Team members will bring over a project into th

  • Calculating values for setPreferredsize

    I am trying to draw a simple graph. However, I can't seem to get the width size right for when I use setPreferredsize (I need to do this because I am using scroll panes). From my calculations the width is 1500, but it seems to be 3000. Can someone pl