Hi, You need to not use the embedded tomcat server and point the hosted mode to your real server (e.g. localhost:8080).
You do this using the -noserver option passed to the GWTShell. See this reference: http://code.google.com/docreader/#p=google-web-toolkit-doc-1-5&s=google-web-toolkit-doc-1-5&t=FAQ_HostedModeNoServer Regards, Carl. On Feb 18, 12:30 pm, koko <[email protected]> wrote: > Can anyonehelp? > > On 2月17日, 下午4时37分, koko <[email protected]> wrote: > > > Hi Ginger: > > Thanks a lot for your kindhelp:) > > Yeah that's what I really want to do. > > but there is still a problem, now I am just in development period, how > > can I write a servlet that can share the session with GWT project ? > > For now they are using different port and probably different tomcat? > > Also my textara contains some of the pictures, can I get them in the > >PDFas well? > > when I get the content of textarea I just use textarea.gettext(); > > > Thanks a lot for yourhelp! > > > Regards. > > > On 2月17日, 上午9时53分, ginger_ninja <[email protected]> wrote: > > > > Hi koko, > > > > Ian is right, I encountered this exact same problem on the project I'm > > > currently working on. In your case it sounds like you want to send > > > some data from a textarea over to the server and put some dynamic > > > content in thePDF, is that right? > > > > The best solution I've found is to separate what you're doing into two > > > stages. The first stage I call the preparation stage. The preparation > > > stage involves preparing the data create thePDFfrom and storing it > > > somewhere temporarily, in my case I used the user's session. Once the > > > data is prepared and stored away you can safely complete the RPC > > > call. > > > > The second stage is what I call the generation or retrieval stage. > > > This involves actually generating and retrieving thePDFusing the > > > data that was previously stored in the session. This stage is > > > triggered in the onSuccess callback method of the previous RPC call. > > > Really all that needs to be done inside the onSuccess method is to > > > open a new window and point the window.location property to the URL of > > > the servlet you're going to create. Using Ian's technique you can > > > write a simple servlet like he said, generate thePDFusing the stored > > > data, and set the content type to application/pdfbefore writing the > > >bytestream to the servlet's output stream (you can find this inside > > > the HttpResponse object). This will tell the browser that aPDFis > > > coming it's way and it will automatically handle it appropriately. > > > > Dave > > > > On Feb 17, 11:54 am, koko <[email protected]> wrote: > > > > > Thanks Ian, I had tried this way, but what how should I post my data > > > > in textarea to the server side? I encounter like SOP errors, for my > > > > tomcat runs on port 8080, while GWT on 8888, I also tried to set in > > > > the same port 8888, won't work, can you teach me how to configure or > > > > set in detail, I am doing this for my project, thanks for a lot! > > > > Regards. > > > > > On 2月17日, 上午12时34分, Ian Petersen <[email protected]> wrote: > > > > > > On Mon, Feb 16, 2009 at 4:05 PM, koko <[email protected]> wrote: > > > > > > I have a problem with convertingbytearraytopdffile, this will be > > > > > > processing in the client side. > > > > > > in my project thePDFfile was constructed by the content in the > > > > > > textarea which user type in, after user pressPDFbutton it will > > > > > > trigger RPC call and getbytearrayresponse from server side, > > > > > > actually it was aPDFfile, I want to shown it to the user and let > > > > > > them download. > > > > > > Now after RPCbytearraywas stored in variable called result, what > > > > > > should I do next? Can anyonehelpme please.. > > > > > > That approach won't work. To serve aPDFto the user, write a servlet > > > > > that spits out thePDF, annotated with the appropriate Content-Type > > > > > header. When the user presses thePDFbutton, either open a new > > > > > window or display an iframe and, in either case, set the URL for the > > > > > new window to be the address of yourPDF-generating servlet. If you > > > > > want to prompt the user to save thePDFto disk rather than displaying > > > > > it the browser, set the Content-Disposition header appropriately. (I > > > > > forget what value you need there, but you should be able to find it > > > > > with a good search engine.) > > > > > > Ian > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~----------~----~----~----~------~----~------~--~---
