Can objects be passed between JSPs?

I want to do this:
I have a set of 4 interfaces that I use to populate data in 4 tables. But the thing is, I need to populate the data only at the end of the 4th interface, when the user clicks on the "Finish" button.
Is it possible to construct an Object for each screen, and pass it to the next one, and finally at the end, write everything to the database?
How can this be done? Please help!!
Regards,
sangita

A quick-n-dirty solution is to keep the objects in session, adn use it subsequently.
For a better solution, you can create a static class which stores the objects(maybe in a Hashtable).
Hope this helps!
-Mak

Similar Messages

  • Can objects be passed between Applets and JSP?

    Can objects be passed between Applets and JSP? If so how? Thanks in advance.
    Scott

    see if this helps,
    http://forum.java.sun.com/thread.jsp?forum=54&thread=136847

  • Pass user-defined Interfaces between JSPs

              Hi, I am using weblogic 6.0wSP1 on win2k. I'd like to pass some
              user_defined interfaces/classes variables between JSPs at run time. I've been
              tried using <jsp:include page...> However, the issue is that it was using http
              potocol to convert my Object into String when I wanted to retrieve the parameter
              using getParameterValues("name"). So does anyone know how I can handle it?
              Any help is appreciated...
              

              Hi, Xiang Rao
              Thank you very much to reply my question. It did work so far.
              Sharon
              "Xiang Rao" <[email protected]> wrote:
              >
              >If you want to pass object to different pages, you should use request.setAttribute(name,
              >obj) and retrieve the object with (Your_class_or_object_cast)request.getAttribute(name).
              >
              >
              >"Sharon Zhou" <[email protected]> wrote:
              >>
              >>Hi, I am using weblogic 6.0wSP1 on win2k. I'd like to pass some
              >>user_defined interfaces/classes variables between JSPs at run time.
              >I've
              >>been
              >>tried using <jsp:include page...> However, the issue is that it was
              >using
              >>http
              >>potocol to convert my Object into String when I wanted to retrieve the
              >>parameter
              >>using getParameterValues("name"). So does anyone know how I can handle
              >>it?
              >>Any help is appreciated...
              >>
              >>
              >
              

  • 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?

  • Share Java Object Instance between JSP's

    Hi@all!
    Can i share a Java Object Instance between JSPages?
    Example:
    Class x
    Public Attribute txt
    Object creation in x.jsp
    set public Attribute txt to "HelloWorld"
    goto y.jsp
    get value from txt
    or...
    a global package
    thnx for help

    Here is a tutorial that explains how to use jsps and javabeans together.
    http://www.roseindia.net/jsp/usingbeansinjsp.shtml
    Quick question is sounds like you are pretty early in your development phase. Have you considered adopting JSF. You may find it a bit easier.
    Regards.

  • Passing values between jsp and php

    hi there, is it possible to pass values between jsp and
    php? i really need to find out the way if there is
    any. thanks in advance
    -azali-

    Yes, there are a few ways to do this.
    1) Think about using Cookies.
    2) Maybe use a Redirect passing the values in the Query string.
    3) Retain the data in a repository in the back end.
    4) Using Hidden fields within your pages.
    I am sure you can use these Idea's for a base to develop other methods on how to pass values back and forth from JSP -> PHP and vice versa.
    -Richard Burton

  • How can I change between JSP and Java in the page language attribute

    Does any one know the answer to this? I am trying to Switch between the 2 in the middle of the page. I want to include a file that uses <%@ page language = "JAVA" %> but the main mage uses Java Script. How can I switch it for this one file. I can't find the answer anywhere. Thanks for your time, and please help me. Also can some one post a good link for Session Tracking. I can't find much good information on that. Thanks again.
    Eagles757(JAY)

    Wow this didn't make sense in so many ways. It's truly bordering on nonsense. I think it's written in English.
    <%@ page language="Java" %>This is optional. JSPs don't use any language other than Java. This is known as a JSP Directive. This line will be processed by the JSP/Servlet engine, and you won't see it in your output. If JSP ever supported a language other than Java, this would be where you would change it.
    <script type="text/javascript">
    <!--
    // -->
    </script>You can include a block like this in your JSP file. The JSP/Servlet engine will not process this script block at all (unless you include JSP <% %> tags somewhere in there, in which case they will be processed before the response is sent back to the web browser). This script block is where JavaScript goes. This code will be executed on the client's browser.
    This is about as clear as I can make things given how muddled your question is. Please ensure you understand the basic differences between JSP, Java, JavaScript, HTML, Servlet engine, web browser before proceeding. Understand what code executes where, and in what order.
    Brian

  • Passing parameters between JSP and Servlet

    The scenario is as follows:
    There is a JSP page that sends a string as a hidden parameter to a servlet:
    <input type="hidden" name=<%= Book.NAME %> value=<%= book.getName() %> >
    In the servlet there is a print statement that checks the parameter value:
    System.out.println("Book name: "+request.getParameter(Book.NAME));
    The problem is as follows: if the name of the book consists of more than one word
    such as "Servlets and JSP", the print statement will print only Servlet.
    If the JSP page passes a string directly as shown here:
    <input type="hidden" name="Test" value="Test String" >
    The servlet will print the complete string: Test String
    The same problem appears if the string is passed between two JSP pages.
    Any help is greatly appreciated.
    Regards,
    Basil Mahdi

    You might want to try
    <input type="hidden" name="<%= Book.NAME %>" value="<%=URLEncode.encode(book.getName(), "UTF-8")%>" >This will take care of any wierd un-url friendly charcters that might appear in the book titles such as the ' or " which may be the problem.

  • Communication between jsp and abstractportalcomponent

    Hello All
    Communication between jsp and abstractPortalComponent.
    jsp contains one input text field and one submit button.
    when the user clicks on submit button it will call the component and that input value will
    display in same jsp page.
    how this communication will happen?
    Rgrds
    Sri

    Hi Srikanth,
    In the JAVA File, 
    OnSubmit Event,
    String inputvalue ;
    InputField myInputField = (InputField) getComponentByName("Input_Field_ID");
    if (myInputField != null) {
                   inputvalue = myInputField.getValueAsDataType().toString();
    request.putValue("textvalue", inputvalue);
    request is IPORTALCOMPONENTREQUEST Object.
    In JSP File,   to retreive the value,
    <%
    String  textstring = (String) ComponentRequest.getValue("textvalue");
    %>
    In PORTALAPP.XML File,
    <component name="component name">
          <component-config>
            <property name="ClassName" value="classname"/>
            <property name="SafetyLevel" value="no_safety"/>
          </component-config>
          <component-profile>
            <property name="tagLib" value="/SERVICE/htmlb/taglib/htmlb.tld"/>
          </component-profile>
        </component>
    Using the code above, You can pass and read values between abstract portal component and Jsp Page.
    Instead of this, I suggest you to use JSPDYNPAGE Component for Data Exchange.
    Check the [Link|http://help.sap.com/saphelp_nw2004s/helpdata/de/ce/e0a341354ca309e10000000a155106/frameset.htm].
    Hope this helps you.
    Regards,
    Eben Joyson

  • Session Data Lost Between JSP's

    Hello,
    I am using Oracle 10g Application Server (9.0.4) on SunOS 5.8. I am trying to upgrade an application previously written for Oracle 9iAS 9.0.2.
    A single JSP (myFile.jsp) is called via a POST operation, and it is initally used to create a frameset that contains two frames. Each frame has a URL link to the same JSP file, with some additional parameters:
    <frameset border="0" rows="*,70">
    <frame NAME="topFrame" SRC="myFile.jsp?PARAMETER1=hello&amp;PARAMETER2=goodbye"/>
    <frame NAME="bottomFrame" SRC="myFile.jsp?PARAMETER1=hello&amp;PARAMETER2=goodbye"/>
    </frameset>
    The problem is that when myFile.jsp is called to generate the actual page for the frames, all the HttpServletRequest data has gone, and only the parameters passed in the Query String remain. I don't want to lose the original POST data - in fact, when I used this on Oracle 9iAS 9.0.2 it preserved the POST data and added the additional queries from the query string so all the parameters were available.
    Has the behaviour of the session manager changed that much between Oracle 9iAS and Oracle 10g 9.0.4? How can I achieve my goal on 9.0.4?
    I tried adding the original POST request to the HttpSession variable as follows:
    session.setAttribute("PARENT_REQUEST",request);
    and then extracting the request data when the JSP is called on subsequent occasions as follows:
    HttpServletRequest newRequest = (HttpServletRequest) session.getAttribute("PARENT_REQUEST");
    But 'newRequest' is actually empty, and it doesn't create an exception. If I debug the session object I notice 2 things:
    1. The session ID remains the same througout all calls of myFile.jsp.
    2. The memory location pointed to by the parameter "PARENT_REQUEST" also remains the same, in the format:
    com.evermind.server.http.AJPHttpServletRequest@1bd5093
    If the session object being passed around by cookies remains consistent, why can I not extract the PARENT_REQUEST attribute from it on subsequent calls to myFile.jsp? Have I misunderstood how HttpSession works? How can I modify my JSP's so that data stored during a session is made available to subsequent calls to myFile.jsp?
    I appreciate any insight you can offer!

    Has the behaviour of the session manager changed that much between Oracle 9iAS and
    Oracle 10g 9.0.4? How can I achieve my goal on 9.0.4?If your experience did suggest something has changed from 9.0.2 to 9.0.4, I would believe that it is more about request management.
    If the session object being passed around by cookies remains consistent, why can I not
    extract the PARENT_REQUEST attribute from it on subsequent calls to myFile.jsp? Have
    I misunderstood how HttpSession works? How can I modify my JSP's so that data stored
    during a session is made available to subsequent calls to myFile.jsp?The "request" in the following code
    session.setAttribute("PARENT_REQUEST", request);
    is just a pointer to the actual request object. Other code, especially the server internal code that manage the http requests and responses can see and manipulate that actual request object. For example, although I am not sure if it is the case, the request objects can be pooled and reused. So it is possible that although "The memory location pointed to by the parameter "PARENT_REQUEST" also remains the same, in the format: com.evermind.server.http.AJPHttpServletRequest@1bd5093", the actual request object at that memory location may have changed. The right way to preserve the original request object is to make a private deep copy of it; however there is no easy way to do that.
    Well, an easy way out is to store directly what you need from the original request. If you would like to store the parameters, try
    session.setAttribute("origParams", request.getParameterMap().clone());
    Although this clone() does a shallow copy, it is probably good enough. To be absolutely sure, you can make a deep copy of everything you need and store them.
    Good luck!

  • Communication between jsps

    Hi All
    What is the best way to pass data between two jsps?
    session or application object(s)please tell me the difference between this two?

    myposts wrote:
    What is the best way to pass data between two jsps?Depends on the scope the data belongs in. I assume it is request scope, you can pass it as request attribute or parameter then.
    session or application object(s)please tell me the difference between this two? Use the session scope for session scoped data only.
    Use the application scope for application scoped data only.
    The request scope lasts from the arrival of the request of the user until the finishing of the response to the client. The session scope lasts from the 1st visit of the user until it get invalidated either manually (HttpSession#invalidate()) or automatically (after 30 mins of timeout, configureable in web.xml) and is shared among all requests of the same user. The application scope lasts from startup to shutdown of the application and is shared among all sessions (and requests).
    This is fairly trivial though. What book/tutorial are you using to learn JSP? Might be worth to look for (a better) one. I can recommend Head First Servlets & JSP of Bates and Sierra.

  • "Portable" way to do message passing between threads?

    (I posted this on the Apple Developer Forums already, but since that forum is only accessible to registered and paid iPhone developers, I thought it would be nice to put it here as well so as to get some more potential eyeballs on it. I apologize if this kind of "cross-posting" is not kosher/is frowned upon around here.)
    Hey everybody,
    "Long-time listener, first-time caller," heh.
    I've been working for the past 2-3 months on my very first iPhone app. Actually, what I've been working on is a framework that I plan to use in an iPhone app of my own but which I am also trying to write for the "lowest-common-denominator" so that I (and others) can use it in other apps written for both Mac and iPhone.
    Not only is this my first time writing an iPhone app, it is my first time writing for any Apple platform. In fact, it is my first time using Objective-C, period. I cannot stress this enough: I am a "n00b." So go easy on me. I also have not worked with threading before this, either, on any platform, so the learning curve for me here is rather significant, I'm afraid. I am NOT afraid of either taking the time to learn something properly OR of rolling up my shirtsleeves and working. However, on account of my experiences so far, I am finding myself (not to flame or anything!) quickly becoming frustrated by and disillusioned with not so much Objective-C itself, but the Foundation frameworks.
    So with that said, read on, if you dare...
    The basic idea behind my project is that the framework I am writing will present an API to developers which will allow them to write client apps that interact with a particular network appliance or network-aware embedded system. I already have my basic set of classes up and functioning, and the framework works to my satisfaction both on MacOS and iPhoneOS. The platforms I am targeting are MacOS X Tiger 10.4 and later, and iPhoneOS, and up until this point, I've managed to keep a codebase that works on all of the above.
    What I wanted to do next was add some multithreaded goodness to the mix. (Woe is me.) I have asynchronous network socket I/O working within the main thread, and it, in fact, works a treat. In my test app on the phone, I've managed to keep the UI nice and responsive by using the main thread's runloop efficiently. But even though TCP async I/O works fine within the main thread, I want to be able to split out and offload the processing of any data received by the app from the appliance to its own thread. (It is possible, and even desirable, for an application using this framework to be connected to multiple appliances simultaneously.)
    My idea, in order to try to keep things as simple and as clean as possible, was to implement a wrapper class that presented my other main class as an "actor." So, rather than instantiating my main class, one would create an instance of the wrapper class which would in turn control a single instance of my main class and spawn its own thread that the network connection and all data processing for that particular connection would run within.
    (I hope I'm making sense so far...)
    Out of the gate, writing a subclass of NSThread sounds like the logical design choice for an "actor-type" thread, but because I was trying to maintain Tiger compatibility, I stuck with +detachNewThreadSelector:etc.
    Once I decided to pursue the actor model, though, the main problem presented itself: how to best pass messages between the main thread and all of the "actor" threads that might be spawned?
    I stumbled upon -performSelector:onThread:withObject:, and knew instantly that this was exactly what I was looking for. Unfortunately, it doesn't exist on Tiger; only its much more limited little brother -performSelectorOnMainThread:withObject: does. So I kept looking.
    All of the pre-Leopard documentation, tutorials, and sample code that I read indicated that to pass messages between threads, I needed to basically pretend that the threads were separate processes and use the expensive Distributed Objects mechanism to get messages back and forth. Unfortunately, even if that WAS a desirable option, iPhoneOS does not have any support for DO! Grrr...
    Finally, I thought I found the answer when I ran into a third-party solution: the InterThreadMessaging library from Toby Paterson (available @ http://homepage.mac.com/djv/FileSharing3.html). In this library, the author basically implemented his own version of -performSelector:onThread:withObject: called -performSelector:withObject:inThread:. Sounds close enough, right? And actually, it is pretty darn close. It's made to do exactly what it sounds like, and it does it in a platform-neutral way that works on pre-Leopard systems as well as iPhoneOS, using Mach ports instead of DO.
    (...wellll, ALMOST. I discovered after I built a small test app around it that it actually isn't "iPhone-clean." The author used an NSMapTable struct and the NSMap*() functions, which don't exist in iPhoneOS, and he also implemented the handlePortMessage delegate method, but although iPhoneOS has NSPort, it DOESN'T have NSPortMessage. GAAARGH. So I took the time to replace the NSMapTable stuff with NSValue-wrapped objects inside of an NSMutableDictionary, and replaced the handlePortMessage method implementation with a handleMachMessage method, which took some doing because I had to figure out the structure of a Mach message, NO thanks to ANY of the available documentation...)
    Once I started using it, though, I quickly discovered that this implementation wasn't up to snuff. My "actor" class and my main thread will be passing a ton of messages to each other constantly whenever there is network activity, and with InterThreadMessaging, I found that whenever activity started to ramp up, it would collapse on itself. This mostly took the form of deadlocks. I found a note that someone else wrote after experiencing something similar with this library (quoted from DustinVoss @ http://www.cocoadev.com/index.pl?InterThreadMessaging):
    "It is possible to deadlock this library if thread A posts a notification on thread B, and the notification on B causes a selector or notification to be posted on thread A. Possibly under other circumstances. I have resolved this in my own code by creating an inter-thread communication lock. When a thread wants to communicate, it tries the lock to see if another thread is already using the InterThreadMessaging library, and if it can't get the lock, it posts a message to its own run-loop to try again later. This is not a good solution, but it seems to work well enough."
    So I tried implementing what he described using a global NSLock, and it did help with some of the deadlocks. But not all. I believe the culprit here is the Mach ports system itself (from the NSPortMessage documentation for -sendBeforeDate:):
    "If the message cannot be sent immediately, the sending thread blocks until either the message is sent or aDate is reached. Sent messages are queued to minimize blocking, but failure can occur if multiple messages are sent to a port faster than the portís owner can receive them, causing the queue to fill up."
    InterThreadMessaging in fact calls -sendBeforeDate: and exposes the deadline option, so I tried setting a really short time-to-live on the Mach messages and then intercepted any NSPortTimeoutExceptions that were thrown; upon catching said exceptions, I would then re-queue up the message to be sent again. It worked, but Performance. Was. A. Dog. At least the message queue wouldn't be full indefinitely anymore, causing the main thread to block, but during the whole time that these messages were expiring because the queue was full and then being re-queued, either the main thread was trying to send more messages or the actor thread was trying to send more messages. And as far as I can tell, the Mach ports queue is global (at the very least, there is seemingly only one per process). The message would get through with this model...eventually.
    JUST IN CASE the problem happened to be something I screwed up as I was rewriting portions of the InterThreadMessaging library so that it would compile and work on the iPhone SDK, I substituted in the original version of the library in my Mac test app to see if any of these problems became non-issues. I found that both versions of the library -- mine and the original -- performed identically. So that wasn't it.
    Finally, in frustration I said, "screw it, I'm going to try it the Leopard way," and replaced all of the method calls I was making to InterThreadMessaging's -performSelector:withObject:inThread: with calls to Foundation's native -performSelector:onThread:withObject: instead, changing nothing else within my code in the process. And wouldn't you know: IT WORKED GREAT. Performance was (and is) fantastic, about on-par with the non-threaded version when only dealing with a single connection/instance of my class.
    So, in the end, I was able to do nothing to salvage the InterThreadMessaging implementation of cross-thread method calling, and as far as I can tell, I'm out of (good) options. And thus my mind is filled with questions:
    How is the Leopard -performSelector:onThread: method implemented? I'm guessing not using Mach ports, given that I didn't have the same blocking & deadlocking problems I had with InterThreadMessaging. Is it possible to re-implement this Leopard+ method in a similar manner as a category to NSObject under Tiger? Or is it possible, perhaps, to increase the size of the Mach ports queue so that InterThreadMessaging works at a sane level of performance? Or -- I'm getting desperate here -- is there any way that I could trick -performSelectorOnMainThread: to target a different thread instead? (I am assuming here that -performSelectorOnMainThread is implemented under-the-hood much like the new -performSelector:onThread: is implemented, but with a hard-coded NSThread pointer built-in to the code, and that the new method just exposes a more flexible interface to what is basically the same code. I'm probably wrong...) Is there another third-party library out there that I've missed that fits my requirements for being able to do message-passing between threads in an efficient and portable manner?
    I refuse to believe that there is no way for me to maintain compatibility with all of the platforms I wish to support without having to resort to making preprocessor #ifdef spaghetti out of my code. And there SURELY has to be a better way of doing cross-thread message passing in Tiger without using Distributed Objects, for Pete's sake! Is this really how people did it for years-on-end since the dawn of NeXT up until the advent of Leopard? And if there really, genuinely wasn't another alternative, then what is up with the lack of DO in iPhoneOS?? Does Apple seriously intend for developers who have good, solid, tested and working code to just chuck it all and start over? What if there was some aspect of DO that previous implementations relied upon that cannot be recreated with simple -performSelector:onThread: calls? (I don't know what those aspects would be...just a hypothetical.) I mean, I can understand needing to write new stuff from scratch for your UI given how radically different the interface is between the Mac and iPhone, but having to reimplement back-end guts such as something as elemental as threads...really?!
    I do laud the inclusion of the new method in Leopard as well as the new ability to subclass NSThread itself. But for those of us that need to support Tiger for one reason or another, some of these restrictions and omissions within iPhoneOS seem like rather pointless (and frustrating) roadblocks.
    As I hope is obvious here, I have tried to do my homework before throwing up my hands and pestering y'all. If you have the patience to deal with me, please tell me what I am missing.
    Thanks for taking the time to read,
    -- Nathan

    Thanks again for your patience. Comments below.
    etresoft wrote:
    It is pretty unusual that anyone would want to call perfomrSelector on any thread other than the main thread.
    What I described in my original post was not a worker thread, but an "actor."
    It is hard for me to answer this question because there are so many options available to do "message passing". The fact that you think there are so few tells me that you really aren't sure what you need to use.
    I didn't say there were few options for message passing. I said there were few options for message passing that fit my criteria, which are that any potential solutions should both A) work efficiently and with good performance, and B) be available both pre-Leopard AND on the iPhone. -performSelector: ain't available before Leopard. Distributed Objects is overkill. Kernel Mach messages apparently have a high overhead, too, as my experience with the third-party library I wrote about in my original message shows.
    ...consider notifications.
    I thought notifications couldn't be posted across threads, either. How do I post a notification to another thread's default notification center or notification queue from a different thread?
    The notification center is owned by the process. Each run loop can listen for just the notifications it wants. You don't "pass" or "send" notifications, you run then up the flagpole for all to see.
    I am aware of how to use notifications. The documentation for NSNotificationCenter clearly states that "In a multithreaded application, notifications are always delivered in the thread in which the notification was posted, which may not be the same thread in which an observer registered itself."
    So, again, I don't see how one thread can post a notification in such a way that the observer's registered method is executed in another thread (posting notifications "across threads"). This probably isn't a big deal if you are using mutexes (assuming you don't actually care which thread carries out the task associated with the notification posting), but as I said before, this is not what I'm after.
    I don't know what you are really after.
    Allow me to attempt to explain a second time, in a more concise fashion.
    My app will have multiple, persistent TCP connections open, one connection per remote device. The user will be able to select a task to execute on a particular device that we have a connection open to, and get back from the application real-time updates as to the progress or results of the execution of that task. In certain cases, the length of the task is infinite; it will keep executing forever and sending back results to my application which will update its display of the results every second that ticks by until the user STOPS that particular task.
    This can be done simply using async I/O in the main runloop, sure. But if I were going to thread this so that I could be processing the results I've received back from one *or more* remote devices while also doing something else, given that I will only have one (persistent) connection open to any given remote device that I'm interacting with (that is to say, I won't be opening up a separate TCP session for every single task I want to execute on a single device simultaneously), it makes sense _to me_ to implement this as I've described: with every connection to each remote device getting its own thread that lasts for the lifetime of the TCP session (which could be the entire time the application is running, times however many devices the user wishes to be connected to while in the app). I won't be spawning a new thread for every task the user wishes to ask a remote device to do.
    This is why (I think) I need bi-directional messaging between the main thread and each of these threads dedicated to a given remote device that we have an active session with/connection to. The main thread needs to be able to tell remote device X (which already has a running thread dedicated to it) to do task A, and then get real-time feedback from that remote device so that the main thread can be displaying it to the user as it is coming back. Same with remote device Y running task B, simultaneously. At any time during the execution of these tasks, the user needs to be able to tell my app to stop one of these tasks, and the main thread needs to send that message to one of the remote devices via that device's dedicated thread.
    This is why I am talking about this in terms of the "actor model," and not the "worker thread model," because the former model seems to fit what I want to do.
    -- Nathan

  • Is it possible to get locked objects in passed time?

    Hi,
    I would like to get locked objects in passed time. The oracle version is 9i.
    For example,
    Can I get a list locked objects five days ago? Because I would like to keep locked objects statistics?
    Does these information stored?
    regards,

    Hi,
    your best shot is ASH (active session history). It contains information about active sessions, their wait events, wait times, blockers, objects accessed, SQL running etc. For recent events you may query V$ACTIVE_SESSION_HISTORY, if you are interested in older data then you can try
    looking in DBA_HIST_ACTIVE_SESS_HISTORY.
    There are many limitations when analyzing ASH data, such as:
    1) limited retention time
    2) periodic sampling (you won't be able to see anything that falls in between snapshots)
    3) bias towards longer events
    etc.
    so you need to be careful when analyzing these data.
    Best regards,
    Nikolay

  • What is the difference between jsp :include and server side include

    what is the difference between jsp :include and server side include(request dispatcher include method)????
    i understand that both request dispatcher include method and jsp:include take dynamic data,so when would one use request dispatcher include and when jsp:include.
    Is the usage interchangeable?i believe jsp include is used only for jsp/html but include directive can be used to include servlets ,jsp and html....correct me if i m wrong and
    do suggest if u hav ny other diff in this context...

    The difference really is: in what format do you want your inclusions? If your environment has many Java developers and only a few designers that focus mainly on, say, Flash, that might push you more towards the server-side include() directive. Or, if you have a large set of pages that receive dynamic content that is displayed in a consistent fashion (such as a workflow header area on a page).
    If, on the other hand, you have more web designers, there may be a greater desire to deal in markup rather than Java code. Java developers themselves might prefer to view markup (JSP) that more resembles the eventual output than something occuring in Java code.
    Finally, there are considerations of tiering. While it is totally possible to (and I have previously) implement 'view classes' that render markup or generate layout templates, JSP's offer, IMO, a subtle, psychological advantage. By forcing a developer to work in a different format, markup versus Java source, the separation on view from controller and model becomes a bit easier. It is still possible to make mistakes, but if a developer at some point notices, "Wait, I'm in a JSP, should I be importing a java.sql class?", then the choice to use JSP includes has paid off in spades.
    - Saish

  • Urgent....How can i redirect to my jsp page from servlet in init() method..

    How can i redirect to my jsp page from servlet in init() method..Becoz that servlet is calling while server startsup..so im writing some piece of code in init() method..after that i want to redirect to some jsp page ...is it possible?
    using RequestDispatcher..its not possible..becoz
    RequestDispatcher rd = sc.getRequestDispatcher("goto.jsp");
    rd.foward(req,res);
    Here the request and response are null objects..
    So mi question can frame as how can i get request/response in servlet's init method()..

    Hi guys
    did any one get a solution for this issue. calling a jsp in the startup of the servlet, i mean in the startup servlet. I do have a same req like i need to call a JSP which does some data reterival and calculations and i am putting the results in the cache. so in the jsp there in no output of HTML. when i use the URLConnection i am getting a error as below.
    java.net.SocketException: Unexpected end of file from server
    at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:707)
    at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:612)
    at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:705)
    at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:612)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon
    nection.java:519)
    at com.toysrus.fns.alphablox.Startup.callJSP(Unknown Source)
    at com.toysrus.fns.alphablox.Startup.init(Unknown Source)
    at org.apache.tomcat.core.ServletWrapper.doInit(ServletWrapper.java:317)
    so plz do let me know how to call a jsp in the start up of a servlet.
    Thanks
    Vidya

Maybe you are looking for

  • Can I split a PDF / PCL file when generating using Crystal Report

    Hi, I can generate a big PCL file from sending it to a PCL printer from Crystal. Can I add something to split the PCL file while generating it from Crystal? Any pointers towards splitting a PCL would be appreciated. Thank you Deepa

  • Restore SharePoint Database to new server - What to do about external content type?

    I currently run SharePoint 2010 and have a content database back-up which I want to restore to a new server. I was able to restore to a new server and everything seems to be working, except that I have one list in my previous site which had an extern

  • Repairing Permissions...Meaning of result

    Hello everyone, I have done a permissions repair 2 evenings in a row and the following result appeared after each repair... "group differs on "private/etc/cups" should be 0, group is 26". Does anyone happen to know what that means? Thanks much- joe

  • Open BLOB Content from an Interactive Report in a New Window

    Hi All, I have an Interactive Report with the following query: SELECT ID,   FILE_NAME,   FILE_MIME_TYPE,    FILE_CHARACTER_SET,    DBMS_LOB.GETLENGTH(FILE_CONTENT) FILE_CONTENT,    FILE_LAST_UPDATED  FROM FILESThe Number/Date Format property for the

  • Preview opens multiple pdf's in same window

    Since upgrading to Mavericks, Preview frequently (but not always) opens pdf's in an already open window.  The preferences are set to open each pdf in its own window, but that is being ignored.  If I could easily separate them, it would not be such a