JSP:Include directive - can I access data?

Hi,
I am using the 'include' directive (either jsp:include method or <%@ include.... /> ) to include another jsp page.
I want the included file to access variables that have been set up in the main page (the one with the include directive in it). I've tried several things, including setting up a Bean class, but nothing seems to work
Is this possible? I really appreciate any help with this.
Thanks.

You cannot use <%@ include ..%> because that is resolved at translation time. <jsp:include /> is resolved dynamically and should give you what you need. In the main page, store references to the bean or other data as request attributes and then retrieve them in the included page.

Similar Messages

  • HT3275 how can i retrieve information from  time machine if my computer has less storage capacity? How can I access data that is on my time machine but can not be copied to a computer with less storage capacity? I used to have 180 GB, now I have 128 GB.

    how can i retrieve information from  time machine if my computer has less storage capacity? How can I access data that is on my time machine but can not be copied to a computer with less storage capacity? I used to have 180 GB, now I have 128 GB.

    Plug an external drive into the computer and use that to expand data onto.
    http://pondini.org/TM/16.html

  • Difference between jsp:forward sendRedirect and jsp include directive

    Am very much confused, please explain me the difference between
    jsp:forward sendRedirect and jsp include directive with a suitable example.
    I'll be very gratefull. Its very urgent.

    One basic difference. The include executes in the .jsp servelet created. The redirect transfers "control" by redirecting the client request to another destination. In other words, the current .jsp is no longer in charge or in the calling chain in any way.

  • JSP include directive not working with Tomcat 5.0

    Hi.
    I'm developing a small JSF webapp under Tomcat 5.0. My idea was to use the include directive to display a navigation panel on every JSP page.
    I took the code straight from the Java Web Services Tutorial; the resulting page looks like this:
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
              xmlns:f="http://java.sun.com/jsf/core"
              xmlns:h="http://java.sun.com/jsf/html"
           version="2.0">
    <jsp:directive.page contentType="text/html;charset=iso-8859-1"/>
    <%@ include file="/jsp/panelpage_header.inc" %>
         <h:outputText value="Welcome!"/>
    <%@ include file="/jsp/panelpage_footer.inc" %>
    </jsp:root>However, when I try to load the page, a compilation error occurrs:
    org.apache.jasper.JasperException: /trias/welcome2.jsp(11,2) The content of elements must consist of well-formed character data or markup.
         org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
    ...I checked the path to the included files, and it seems to be okay. The files themselves contain the JSF tags for the view, html-head, html-body etc. The compiler doesn't even care if the files exist or not because it aborts immediately when it reaches the first include-statement.
    Did anyone see this kind of error before?

    Ok, the solution with jsp:directive.include works,
    if header.inc and footer.inc themselves are well
    formed too. If I understood the concept right this is
    because header and footer are processed during
    request time and therefore interpreted as
    'standalone' pages.This isn't true. The include directive (<jsp:directive.include>) is run a Compile Time. The code is inserted directly into the surrounding JSP (unlike <jsp:include> which forwards the request at runtime). The finished JSP, after the include, is then processed and needs to be well-formed XML.
    >
    But: What can I do when these two files define a tag
    that should enclose my current page (for example,
    header opens a panelGrid-Tag, and footer closes it).
    For this case I thought the use of the
    @include-directive would be neccessary to combine the
    three pages during compilation. By this the resulting
    page would be well-formed although header and footer
    are not.It should be, as long as you are using <jsp:directive.include>, and the rest of the included pages are also well formed (no <% %> tags, nothing else out of place...).
    Honestly, I haven't done much work with JSP documents, so I haven't run into this problem. But I do believe everything I said is correct.
    What I would do is double check the correctness of the rest of the included pages and see if your error isn't something else.

  • Jsp:include directives compilation errors

    hi,
    we have lot of <%@ include file="" %> files in out jsp page. when we trying to change this to <jsp:include page="" %>. we r getting lot of comilation errors
    The file size is increasing more than 64mb.
    Can u tell how to contain them within 64mb .
    thank you.

    The stack trace isn't very indicative of whatever problem you may be having.
    However, there is a major difference between <%@ include %> and <jsp:include />. The include directive <%@ include %> slams the content of the included resource into your JSP at compilation time, it is "static". No individual evaluation of the included resource is done, it becomes a part of the JSP that included it.
    <jsp:include /> is a dynamic include--it is evaluated at run-time. The content of the included resource is accessed and written to the output stream with the JSP is accessed. If the included content is a JSP, it is compiled and accessed as a separate servlet.
    So, it looks like your included JSPs do not qualify as valid, standalone JSPs. Typically, this is because of some dependency on variables or beans declared in the including JSP.
    Good luck.
    -brian

  • How can I access data from accidentally deleted user?

    I was given a MacBook Pro by a family member. I set myself as the Administrator, but could not get rid of the previous owner's name on the Home folder.
    In my attempts I accidentally deleted something that made the entire computer unaccessable. I can boot up, however, all the work and applications I installed are unaccessable. I can't even open Preferences.
    I used TechTool Pro to start up and explore the drive, and found that the previous owner's name was on a folder with a red-circled minus sign. The data (considerable) was inside, but I can't access it.
    Is there any way I can get access to that data? I slaved the laptop to my iMac and transferred the folder (with 32 gb of data).
    When I tried to open it I got the message: "The folder "sandy....." can't be opend because you don't have permission to see its contents." I used Get Info on the folder and changed Sharing and Permissions to Read and Write, but still no access.
    What can I do, if anything to gain access to that folder?

    http://docs.info.apple.com/article.html?path=Mac/10.7/en/mchlp2968.html

  • Can't access data after name change of account in Time Capsule

    I started using Time Capsule (TC). After transferring data to 3 different accounts. I noticed that the process of entering/ connecting to your account takes to much time. You have to connect every time to the account on TC. Because of this I changed the account names in the Airport Utility to shortened two lettre names. Unfortunately with great negative impact!
    I cannot access any data anymore. The new accounts are empty although I can see that there is still data on my TC because the available disk has not changed.Changing accountnames looks like you are creating new ones and blocking the access to the old ones.
    1) How can I retrieve the data?
    2) Can you create a 'super account' which can access all data of all accounts?
    Jeroen
    The Netherlands

    How do you reset?
    Hi..
    What I wrote is my experience.. there is other opinions out there.
    See https://discussions.apple.com/docs/DOC-2280
    What I experienced was that applying user profiles over existing files resulted in nothing being visible.
    But I am eggs spurt by self appointment only.. test everything.. hold to what is right.. reject the nonsense I will on occasion (unwittingly) spout.
    To answer your questions.. press the reset button for 1sec will reset all user profiles to default. A longer press and it will get rid of them completely.. You will go back to default settings.
    http://support.apple.com/kb/HT3728
    The no user profile option is device password.. or disk password.. when you press reset it will return to device password.. that is the default.
    Try what the reference above suggests.. but in my experience you cannot apply user profiles after copying material and still access it.

  • I can't access data from my iPhone 5 when off wifi

    I bought my iPhone 5 two weeks ago from Optus, Australia. I loaded up my back up from the iPhone 4, it all seemed ok. However when I was off wifi I had no data access. I replace the SIM card and Apple even replaced the handset. Neither of those helped.
    But finally today, I figured it out with some help from Optus.
    I backed up the phone, wiped it but did not restore it from the iTunes backup. I treated it like I'd never had an iPhone before. It worked. It appears there was something corrupt in my back up file.
    Everything is in the cloud, mail, calendars, contacts etc and of course all my apps were in iTunes along with music, podcasts etc. so I haven't lost anything.
    I just wanted to share this in case you're having the same problem. 
    Cheers
    Derek

        Yakkity-Yak,
    Let's get your services functioning again!  I know it must be frustrating not being able to access anything.  Have you restarted your iPhone?  What zip code are you located in?  Are others experiencing troubles in the area?  Please fill us in on some details so that we can better assist. Thanks!
    TrevorC_VZW
    Follow us on Twitter @VZWSupport

  • Failing/Failed Harddrive - How can I access data?

    The HDD in my Powerbook G4 is seriously failing and when checked with Disk Utility it says that I must backup what I can and replace it.
    The computer won't boot and the drive is audibly shagged. The best I can do is boot to CD and use Disk Utility from there (where it tells me how broken my computer is). My computer gets an IP address when booted from CD and I can ping it from another computer but I cant access the user accounts as I normally can using \\ipaddress\username. This isn't too surprising really.
    Does anyone know how I might be able to access my data?
    Thanks
    Chris
    P.S. Please don't ask me if I've been taking regular backups over the last 2 years and as such might not have lost absolutely everything!

    Does this sound like the a hard-drive that is accessible? If I connect it via Firewire disk mode I assume that my HDD will act like an external HDD attached to the 2nd machine?
    Hi, Chris. That sounds like a hard drive that may be accessible on the same momentary and much-interrupted basis as it is now for a few more seconds, minutes, hours or days — there's no way to tell. You might get really lucky and have a chance to back all your files up in one attempt via FW Target Disk Mode, or you might get halfway through backing up the first file and have the drive quit for good. Or you might get part of your data backed up, but only in the course of a hundred restarts. All we can do is wish you luck and point out that given the uncertainty of the situation, you'd better begin the backup process with your most important files. Plan ahead, and have your highest-priority files listed.
    Yes, in FWTDM the drive will appear as an external drive connected to the host Mac.

  • Can not access data generator in HANA SHINE Content

    Hi Expert,
      After import Delivey Unit of SHINE Content, then i was told by the Guide Book that i could use data generator to generate demo data by access URL
    http://<myServer>:<XS Port>/sap/hana/democontent/epm/admin/ui/WebContent/admin.html
    STEP1:I used SYSTEM on the HANA login page
    STEP2:Error 404 refelect
    Does anyone else have encountered this problem?
    Message was edited by: Tom Flanagan

    You might check the repository browser, but I don't believe that URL is correct.  There is no ui or WebContent folder in the path in my system.  Its just /sap/hana/democontent/epm/admin/
    But I suggest checking the folder structure in the Repositories view in your own system to make sure. My system is a new version and could be different than what you are seeing. However this would explain why you are getting the 404. 
    Also make sure that SYSTEM has the necessary SHINE admin role added.

  • Customer DIFOT including Direct Store Delivery (DSD) data

    Hi,
    Has anyone brought Direct Store Delivery data (tables starting '/DSD/') into BW to enhance shipment or delivery data? If so have you found or worked out the relationship between the major tables? Found any documentation?
    Thanks,
    Ken

    Close thread as there are no answers to questions.

  • How can I access data in different panels?

    Hi,
    I'm a beginner in Swing and have a simple(?) question. Unfortunately I didn't find the answer by oneself so I hope you can help me.
    I have three classes. In the GUI.java class I build the JFrame and it's components. All components are added to the frame via panels that a separate classes.
    My problem is: how can I acces the values in PanelB when I call the actionPerfomed in PanelA? Or is that always a bad design? How can I make it better?
    GUI.java
    JFrame frame = new JFrame();
    PanelA panelA = new PanelA();
    PanelB panelB = new PanelB();
    frame.getContentPane().add(panelA);
    frame.getContentPane().add(panelB);PanelA.java
    private class ButtonCalculateAction implements ActionListener {
         public void actionPerformed(ActionEvent e){
              //calculate with valuesX and valuesY from Panel B
    JButton buttonCalculate;
    ...PanelB.java
    JList valuesX;
    JList valuesY;
    JButton addValueX;
    ...

    Here is the code for a Short, Self Contained, Correct (Compilable), Example
    GUI.java
    import java.awt.FlowLayout;
    import javax.swing.JFrame;
    public class GUI {
         public GUI(){
              JFrame frame = new JFrame();
              PanelA panelA = new PanelA();
              PanelB panelB = new PanelB();
              frame.getContentPane().setLayout(new FlowLayout());
              frame.getContentPane().add(panelA);
              frame.getContentPane().add(panelB);
              frame.setSize(400, 200);
              frame.setVisible(true);
         public static void main(String[] args) {
              GUI gui = new GUI();
    }PanelA.javaimport java.awt.event.*;
    import javax.swing.*;
    import java.awt.*;
    public class PanelA extends JPanel {
         public PanelA(){
              this.setLayout(new FlowLayout());
              this.buttonCalculate = new JButton("Calculate");
              this.buttonCalculate.addActionListener(new ButtonCalculateAction());
              this.add(buttonCalculate);
              this.result = new JTextField("...");
              this.add(result);
         private class ButtonCalculateAction implements ActionListener {
              public void actionPerformed(ActionEvent e){
                   //calculate with values from PanelB. How??
                   //result = ?
         private JButton buttonCalculate;
         private JTextField result;
    }PanelB.java
    import java.awt.event.*;
    import javax.swing.*;
    import java.awt.*;
    public class PanelB extends JPanel {
         public PanelB(){
              this.addValueX = new JButton("Add X");
              this.addValueX.addActionListener(new ButtonAddAction());
              this.valuesXList = new DefaultListModel();
              this.valuesX = new JList();
              this.valuesX.setModel(valuesXList);
              this.add(addValueX);
              this.add(valuesX);
         private class ButtonAddAction implements ActionListener {
              public void actionPerformed(ActionEvent e){
                   valuesXList.addElement(47);
         private JList valuesX;
         private DefaultListModel valuesXList;
         private JButton addValueX;
    }

  • How can I access data on an external drive in my mac after all folders have been turned into .lnk files? I am desperate!

    I don't know what happened, I connected my external hd today and all files had been turned into that!

    I know I am going to sound really stupid when I ask this, but how do I do that? There was this folder called Recycle Bin, which I have deleted already but the files are still in the same format. I know they are in the HD 'cause of the space taken up in it, but I would like to know exactly what to do to clear the malware altogether and have access to the stuff I have again.
    Thank you very much in advance and sorry for being such a dummy

  • JSP ERROR! Can't run "DATE"example

    Hello All,
    I am gettin a pretty simple error. I am trying to build and deploy the jwstutorial13\examples\web\date example. What happens is the it builds perfectly but when i install it says it is installed but when i go into the directory manager and try and run in..it is a stopped state!!! and says that it cannot find the context path!! does anyone know how to fix this problem!! Any help would be much appreciated.
    Thanks In advance
    mark

    its stoped because the buil.properties file classpath is wrong

  • How to include servlet in JSP using Include Directive?

    Hi experts,
    am a beginner to JSP.. I want to know,
    is it possible to include a servlet in jsp using include directive? could any one explain me...

    No it is not possible.
    Include directive is like copying and pasting some text into a JSP file, and then translating/compiling it.
    So the only thing you can include with the <%@ include %> directive is a jsp fragment
    It is a static translation/compile time include and thus will always be the same
    By contrast <jsp:include> is a runtime include, and includes the result of running the imported url.
    That URL has to be a complete/standalone jsp/servlet/whatever. However as it is runtime, it can take parameters where the include directive can not.
    Does that answer your homework question?
    Cheers,
    evnafets

Maybe you are looking for

  • CrystalReport problem with CSS in VS 2010

    Hi, Please help me with following issue: I have an ASP.NET project and it contains a lot of reports (.rpt, CrystalReports). All worked fine untill I updated my CrystalReports to version 13. (were VS2008, .NET 3.5, now VS2010, .NET 4.0, CR13.0 ) All m

  • How can I find my password for iTunes?  Forgot it and can't see how to restore or change

    How can I find my password for iTunes?  Forgot it and can't see how to restore or change it.  It is not the same as the apple id password - or so my iPhone iTunes says - Help

  • Can't restore Fifth Generation I-Pod

    I first had a 20 GB I-pod, and I recently downloaded the latest version of I-tunes. So when I got the I-pod video, I thought I didn't need to install the lates software- I already had it. So I just plugged in the new video I-pod to the computer and w

  • External Table woes

    Hi all, I have an external table set up to read a text file and update two fields in a table via batch file that launches a SQL script (batch file is for sheduling in Windows task manager, can't use Enterprise Manager due to embedded license). It's a

  • Regarding LDB PCH

    Hi, i need to hide all the defualt select options for LDB PCH and add the custom select potions. how to hide the default select options completely. Thanks in advance.