Printing from methods other than doGet()

Hi,
I want to send back a "result" string to the client side browser. Now, the problem is that it should be sent back from a method different from doGet(). Iam doing something like this................
public class A extends HttpServlet
PrintWriter out;
public void doGet() throws......................
out = response.getWriter();
public void someOtherMethod()
out.println(result);
The call in someOtherMethod() is not working. What should be done for this ?
Thank you.

Hi,
Thank you for the reply. I have tried it. The problem is Iam using a Timer class. Have a look at the code Iam using.......
public class event extends HttpServlet
private Timer t;
private static int count = 1;
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException
String eve;
String res;
eve=request.getParameter("opt");
EventAgent de=new EventAgent();
res=de.sendEventToEventAgent(eve);
PrintWriter out = response.getWriter();
out.println(res);
t = new Timer();
t.schedule(new GenerateRegNo(request,response),2,12000);
class GenerateRegNo extends TimerTask
private Random r;
private int no;
private String result;
private PrintWriter out;
public GenerateRegNo(HttpServletRequest req,HttpServletResponse
res) throws IOException
r = new Random();
out = res.getWriter();
public void run()
if(count <= 20)
DispReg();
count++;
else
t.cancel();
public void DispReg()
no = r.nextInt(3);
if(no == 0)
no = no + 11;
else
no = no + 10;
EventAgent de=new EventAgent();
result=de.sendEventToEventAgent(String.valueOf(no));
out.println(result);
Still not getting the desired result..........
Thank you once again.

Similar Messages

  • Using applescript to print from printers other than the default

    Hi
    I have this script to print from Quark which works fine:
    tell application "QuarkXPress"
    tell print setup of document 1
    set separation to false
    set printer type to "HP Laserjet 8150 Series"
    set paper size to "A3"
    set orientation to portrait
    set bleed to "3"
    set page position to center horizontal
    set print spreads to false
    set reduce or enlarge to "100%"
    set registration marks to centered
    set tiling to off
    end tell
    print document 1
    end tell
    It works fine but if I change my default printer to something else eg. our canon colour printer, then the document prints from there instead.
    If anyone can help it would be much appreciated
    Kind Regards
    Andrew

    Thanx Nova Scotian..
    Didnt quite work but i got this from another forum which did in case your interested:
    tell application "Printer Setup Utility"
    set the visible of every window to false
    if printer "ExactPrinterName" exists then set current printer to printer "ExactPrinterName"
    get current printer -- debugging
    if (current printer is not "ExactPrinterName") then display dialog "Please setup your 'ExactPrinterName'!!"
    quit
    end tell
    Of course, ExactPrinterName is the name of the printer you WANT to use as it exists in the Printer Setup list.
    Andrew

  • Faded colors when printing from Acrobat - different than previous

    Hi
    I have read some threads about color fading when printing a PDF created in ID and printed from Acrobat. My problem is the same and I am also having the same problem with PDF's exported from Keynote (client created posters). It sounds like I should work with the PDF optimizer for the solution. Has anyone experienced the fading colors from anything other than ID or Quark made PDF's? Did the optimizer fix the problem? I find it frustrating that I can print directly from ID and not have a problem - why can't they all get along!  ;0)
    Using Acrobat 9, Keynote 09 and an Epson 9880 printer.
    Thanks

    RE: "You don't indicate what Xerox printers you have"
    In my first post I named it, is that the information you need?
    Docucolor 3535 using Splash 3535
    That's interesting, so I have to find a way to turn off the printer's Color Management function? I mailed them, hope they can tell me how to do it easily. They usually just tell me to not use any profiles and so on, but that's the general rule in this area, I'm really tired of hearing it. Everybody seems to think profiles and LAB mode are nuclear science and I should stay away from it.
    Anyway, the test image I'm using is a simple photograph (size A3, 300dpi), so no transparencies at all. I'm placing this image into an equally large ID file and print it from ID, then export it to PDF-X/3 and print it from Acrobat. Hope that helps.

  • My iTunes account is no longer showing my playlists or any of the music I have added from sources other than iTunes.

    I discovered that iTunes is no longer showing any of my playlists or music I have added from sources other than iTunes.  My iPod, which is a 4th Gen Classic, seems fine and has all of my playlists and music.  My question is how do I upload my iPod to iTunes so that I don't lose anything?  I have read a lot of posts about people having similar problems and most of them suggest restoring from an old saved file.  I have two problems with this approach 1) I do not have a current back-up and 2) it does not seem to work for any of my non-Apple purcahsed music.  Does anyone know of an easy way to fix this?

    I'd do a "deauthorize all" from a computer you have access to, and then reauthorise the computers you still have access to.
    For instructions, see the following document:
    iTunes Store: About authorization and deauthorization

  • Is there a way to access 11i from outside other than Self service?

    Is there a way to access 11i from outside other than Self service?
    I could connect any application from inside the firewall (basically router) and can not access screens from outside. Eventhough port forwarding 80 allows us upto initial screen, it does not go further.
    Any workaround/suggestions
    Jiltin

    Hi Jiltin,
    If you can migrate your forms server into Forms Listener Servlet.This will allow you to use forms outside firewall provided atleast one port(assuming yours 80) is open.
    Ref to the M.Link Note 201340.1 for how to setup forms listener servlet.
    Magesh

  • Is there any other method other than se78 to upload a graphic into SAP R/3?

    Hi,
      Is there any other method other than se78 to upload a graphic into SAP R/3?
    Anita Jeyan

    hi ,
    just use  OAER or RSTXLDMC program
    it will definately help you
    regards
    rahul

  • Finder Methods other than by Primary key

    How should the Finder methods other than by Primary
    key in Container MB be implemented? In Bean class?
    I did some search in archives to no avail.
    Thanks!!
    Sriram

    I think it might be different on different app servers, at least until EJB 2.0 is implemented everywhere. I found a bit of info on the matter:
    http://www.jboss.org/documentation/HTML/ch06s07.html

  • Forwarding proxy requests from ports other than 80

    Hi,
    Is there a way to forward requests from ports other than 80 to the proxy address? For example, trying to define a rule to forward the requests from port 8080 to proxy_ip...
    Best regards,
    Emre

    Hi Emre,
    Have you looked into using ipfilter port redirecting ?
    It may depend on your configuration.
    /etc/ipf/ipf.conf
    pass in quick from any to any port = 8080 keep state
    pass out quick from any port = 8080 to any keep state
    /etc/ipf/ipnat.conf
    rdr <Interface> <hostname or IP> port 8080 -> <hostname or IP> port 8080 tcp
    Edited by: Hodware on Mar 4, 2013 7:24 AM

  • Denying access from hosts other than localhost

    I would like to prohibit access to Directory Server from hosts other than the localhost:
    I am doing this from Administration Console. On the server node I set the ACI:
    (targetattr = "*")(version 3.0; acl "deny_ip"; deny (all) ip!=dirservhost_ip or ip!=127.0.0.1; )
    But the access is still allowed. What is wrong?

    Purchase a device like this. They are offered by many cellular carriers
    Verizon Wireless - Mobile Broadband -

  • Activating phone bought from source other than Verizon

    If I buy a phone from someplace other than Verizon, how do I go about activating it and using it.

    First, before buying it, make sure it is a Verizon-branded phone. These are the only phones compatible with Verizon's network. Secondly, make sure to get the ESN from the seller and call Verizon Customer Service to make sure it is CLEAN. Third, after both of these check out, purchase it, and when you receive it, just dial *228 from it and select option 1 (make sure your current phone is OFF for this) Or you can go online to My Verizon and activate it there. If you are going from a non-smartphone to a smartphone, you will need to add the $29.99/month data plan, and vice versa.

  • HT1414 Why am I not able to text to phones that are not iPhones?  Nor am I able to receive text msg from phones other than iPhones

    Why am I not able to text to phones that are not iphones?
    Nor am I able to receive text messages from phones other than iphones.

    Settings-messages-send as SMS turned on?
    Have you tried settings-general-reset-reset network settings?
    Tried a reset?

  • Cannot make calls from phones other than my own?

    I have a Skype To Go number for the unlimited US/Canada package.  I cannot make calls from phones other than my own: "Due to technical fault..." What's the point of having Skype then?
    Post transferred to create its own new thread (topic);
    subject/title edited to differentiate from other posts.

    That makes no sense at all. The phone doesn't know or care what kind of phone is calling it. There's something else causing this. Contact your carrier.

  • Online digital photo printing for site other than apple - how get photos easily onto site for uploading

    Want to use an online digital photo printing site (eg Kodak/Photobox) in conjunction with selection of photos in iphoto.  How do I get the photos from iphoto onto the "other"site?  Drage and Drop does not work.  Obviously not made easy to use a site other than Apple, but the price is better
    ijgsaw1984

    Have you tried these?
    http://www.shutterfly.com/prints/prints?cid=SEGOO.GENRL&mpch=ads
    http://fredmeyer.pnimedia.com/

  • Finding files on an iPod Classic that were added from somewhere other than iTunes

    I added files onto an iPod Classic from another source other than iTunes, but can't find that file on the iPod, either its not connected self, or when it is in iTunes.
    So, how do I go about locating the file without going back INTO iTunes and adding the file into iTunes' library?

    Hey thanks, Jim... Actually I do have a back up of my entire library on an external drive. Is the process just dragging the songs and albums from the Finder (from the external drive backup) onto the iPod when I plug it in to iTunes and they copy over? Is it possible to create new or update existing Playlists with this method? But is key is to never sync the iPod with iTunes or do I need to check Manually Manage Music & Videos?
    Or am I looking at this completely wrong. lol

  • When I go to file then print - nothing happens. I can print from email (yahoo) and I can print from any other program on my computer but not from Firefox. Why?

    I cannot get the print menu to work in Firefox. I have no trouble printing from anywhere else on my computer. I go to file and the click on either print or print preview and nothing happens - no window of even an error message appear.

    Hi MollyPhloot07,
    I'm glad you found the coupons.com app and you might also want to take a look at the GroceryIQ app from the same company.  Please note that at this time, printing is only support from iPad to HP wireless inkjet printer.  That's most likely the reason why your Canon isn't displaying when attempting to print.  The other way to go might be emailing the coupons you want to your email address, then open that email and print from a conventional desktop or laptop computer.
    Hope this helps!
    Coupon Support

Maybe you are looking for

  • Installation error in Windows 8.1

    Hi All,    I am developing one Software in Vs 2008 (.Net framework 2.0) . I installed one Win 8.1 system and I am getting Smart screen when installation time. How can i solve this ? Urgent!!!!

  • How can I print out the list of my purchases

    I need to scan my purchases so i can send it to my company for reimbursement.  How can I do this?

  • How to send Itune gift card from UK to Malaysia?

    How to send Itune gift card from UK to Malaysia? Would like to send it as a gift to my Malaysia friend, However, store officials said that itune card bought in UK are only for UK account. Is that true?

  • Digital camera doesn't show up in Finder

    why does my digial camera not show up in Finder?  (camera is Nikon D7000) there are situtions when you don't want to download photos, sometimes I'm just doing tests, and want to see photos in the camera instead of downloading them first.. ( at any ra

  • Need to select number in varchar

    Hi I have a strring like (RAZOR_LADIES_TRPLE_100/CS) ...i want to select only 100 from it ..can we do that using locate function in 11g...i am unable to write proper syntax ..Any help will be deeply appreciated Regards Debo