Using JSP to set form data and automatically submit

I am using JSP to extract the authentication details form the header, and then set these values and automatically submit them them to a javascript cookie function. I can extract the information, but setting and submitting to javascript seems to be a problem. I don't want to modify the original code because that may change, and if it does change, they can just copy the jsp block to the new page. Plus there may be more pages where I will need to do the same. Any suggestions?

I am making this a JSP and hosting it in Tomcat since I already have the authentication extracted and base64 decoded with this at the top:
<%@page language="java"%>
<%@ page import="com.Ostermiller.util.Base64 " %>
<%
String auth = request.getHeader("Authorization");
     auth = auth.substring(auth.indexOf(" "));
     String decoded = new String(Base64.decode(auth));
     int i = decoded.indexOf(":");
     String username = decoded.substring(0,i);
     String pwd = decoded.substring(i+1,decoded.length());
%>
Then it has a form with a field checker and then login function:
function do_login()
if (is_ie)
window.document.authenticate.submitbutton.click();
else
window.document.authenticate.submit();
<form method="post" name="authenticate" onsubmit="return check_fields();">
Log in
I was wrong about the cookie. It doesn't set it in that html file, it just checks to see if a cookie exists, if it does, it passes the user through. Normally I would use a cookie bean to do this, but again I have to do this for multiple sites which have different values and encryption. I just want to pass the credentials through and then let the back end do the rest. Do you know of a better way? Thanks for replying.

Similar Messages

  • HT2822 Setting up date and time is taking forever and failed to do it automatically or manually.

    Hello:
    When I tried to configure my new Apple TV for some reason it kept trying to set the date and time automatically but wasn't able to. I tried to do it manually but couldn't do it either. When I tried to skip this part and log into my iTunes account it said I had to set the date and time first. So it seems like I'm stuck in this loop. Any hints?
    Ricardo Ortiz

    Assuming this is not the first time you have used your Apple TV
    You might try restarting the Apple TV by removing ALL the cables for 30 seconds.
    Also try restarting the router. (Also try removing it’s power cord for at least 30 seconds)
    If the problem persists, try a restore, you may want to try the previous procedures several times before doing this.
    If restoring from the Apple TV doesn't help, try restoring from iTunes using a USB cable.
    If this is a new Apple TV, in addition to trying the above, it may also be that your network router is not allowing access to the timeserver, check that your router allows access over port 123.

  • HT1551 I need to set up date and time on my apple tv.... Not doing it automatically ... I am connected to a router that works on a wireless sim card

    I need to set up date and time on my apple tv.... Not doing it automatically ... I am connected to a router that works on a wireless sim card ...

    OK.
    Go into Settings on the Apple TV and then General-> Time Zone.
    Turn OFF automatically and put your location in manually under Time Zone.

  • From yesterday, I have been facing the problems in my iphone and my wife iphone. The same problem, "cannot connect to itunes store". I have strong internet connection. I tried all the possible way I could like setting, general, date and time.....etc.

    I have proble of "cannot connect to itunes store. After I have updated the new software ios6, the problem arised in one of my mobile. In the second mobile, I didnot updated the software.Today in the morning, the problem ariesed in that mobile as well. I cannot open the itunes, don't have access to apple store . I tried to solve the problem like going to setting, general, Date and time, automatically off, keeping one year ahead date. I tried all the possible options I could get from the googel. How do I get rid of this problem?

    No - I have not tried other routers on my network.
    What I meant was I could use my itouch on other users wireless networks without any issues.
    I'll update the routers DNS to try  using Google's 8.8.8.8 instead of my ISP.
    Is the issue DNS performance using local ISP -or are there other possibel isues when using local isp DNS?

  • On the initial set up for apple tv it just sits there trying to set the date and time . it is a wireless setup and the ipaddress and router address is correct . I can't get by this screen

    On the initial set up for apple tv it just sits there trying to set the date and time . it is a wireless setup and the ipaddress and router address is correct . I can't get by this screen. The setting is on automatic and I have picked a city in my time zone yet it still tries to set a time and date but fails.
    thanks

    Make sure router is up to date. Try ethernet to rule out any wifi issues. Reboot ATV and router.

  • How can I set my date and time to ebay network time server?

    In the system preferences I would like to set the date and time to ebay UK time?
    I thought a quick google would be bring up the server and I can't find it.
    At the bottom of every ebay page there is a link to official ebay time
    But its not a live feed of time to get it to the second.
    I want it to be accurate so that I can use applescript to snipe bargins.
    Many Thanks
    Matt

    Just trying to go along the free route. I found Garage Buy   This doesn't work to well but lets you create an applescript and enters the auction into ical. Then you can set ical to run the script once it gets closer to the time.
    Ical only lets you set a time of a minute before the date. So you have to edit the script to add a Delay 59 to have it run 1 second before. From a few refreshes of the time page it looks like ebay time is a second behind, that could be easily be due to time to load the page. anyway i'll opt for a delay of 57secs and give that a try.

  • Set the date and time

    how to set the date and time in apple tv?

    Welcome to the Apple Community.
    Assuming this is not the first time you have used your Apple TV
    You might try restarting the Apple TV by removing ALL the cables for 30 seconds.
    Also try restarting the router. (Also try removing it’s power cord for at least 30 seconds)
    If the problem persists, try a restore, you may want to try the previous procedures several times before doing this.
    If restoring from the Apple TV doesn't help, try restoring from iTunes using a USB cable.
    If this is a new Apple TV, in addition to trying the above, it may also be that your network router is not allowing access to the timeserver, check that your router allows access over port 123.

  • Setting the date and time on my Verve 450 answerin...

    I have set the time and date on all the handsets, but when we pick up a voicemail, the date and time on the message bears no relation to reality!  The instructions do not provide any advice on setting the date and time on the answering machine.

    Well after i change it it seems fine, but when i use it another time it has been changed.

  • ActiveX in BradySoft (CodeSoft) - What Class/Method/Object's would I use to send variable form data to BradySoft?

    What Class/Method/Object's would I use to send variable form data to BradySoft? I have a basic label setup in BradySoft and I want to send it variable form data (a serial number) from Labview ActiveX. I have attached Brady's ActiveX programmers guide but can't figure out what to use for this. P.S. I would call Brady or TekLynx tech support about this but they have a strict policy whereas BradySoft supports ActiveX but their tech support doesn't provide programming help with it. I figured I'd try the NI Forums.  

    Aaronb, I presume by publishing an ActiveX programmers manual the BradySoft software installs Active X objects. You may choose to interact with these objects within LabVIEW using Active X controls. The following link will provide a starting point for LabVIEW help topics on Active X communication: Select ActiveX Object Dialog Box
    http://zone.ni.com/reference/en-XX/help/371361F-01/lvdialog/insert_active_x_object/
    Building a Simple Web Browser Using ActiveX (Example of ActiveX arcitecture)
    http://zone.ni.com/devzone/cda/epd/p/id/81 Hope this helps provide a bit of guidance. Cheers!  

  • TS4147 i have been using an iPhone 4 till date and now migrated to a iPhone 4s.The contacts are not copied in total from the other phone what should i do

    i have been using an iPhone 4 till date and now migrated to a iPhone 4s.The contacts are not copied in total from the other phone what should i do

    Welcome to the Apple Community.
    Please try the following…
    First check that all your settings are correct, that contact syncing is checked on all devices (system preferences > iCloud on a mac and settings > iCloud on a iPhone, iPad or iPod).
    Make sure the contacts you are adding are added to your 'iCloud' group and not an 'On My Mac', 'On My Phone' or other non iCloud group (you can do this by checking in groups), non iCloud contacts will not sync.
    If you are sure that everything is set up correctly and your contacts are in the iCloud group, you might try unchecking contact syncing in the iCloud settings, restarting your device and then re-enabling contact syncing.

  • I just bought my apple tv and it says that it can't set the date and time? How do i fix this?

    I just bought my apple tv and it says that it can't set the date and time? How do i fix this?

    Welcome to the Apple Community.
    A number of users have encountered this problem, for existing users the problem has largely been resolved by restarting the Apple TV. However since you are a new user it would be wise to check that your settings are correct to begin with. Ensure the router allows access over port 123 (TCP) and that you are using the DNS settings provided by the ISP and not your own.

  • My Apple TV won't set the date and time! What can I do???

    My Apple TV won't set the date and time! What can I do???

    That means it's having trouble connecting to the network. Make sure location is set correctly. DNS should be set to automatic. Ensure router is up to date, reboot all devices. If on wifi try ethernet.

  • I have an A1288 ipod touch I bought about 3 years ago. I am currently trying to download an app however the I'm getting an error message which is essentially saying that the "ios" I'm using isn't up to date and the itunes summary says otherwise?

    I have an A1288 ipod touch I bought about 3 years ago. I am currently trying to download an app however the I'm getting an error message which is essentially saying that the "ios" I'm using isn't up to date and the itunes summary says otherwise?
    Other forums state I have to buy a new one but what happens when this happens again I think I'm moving to another brand this is crazy?

    Yes, there's a limit, and that iPod touch has reached it.
    (72099)

  • HT1551 Can't seem to set te date and time...?

    We are setting up our Apple TV...we can't seem to set the date and time....it just keeps searching?

    All good....the wifi wasn't turned on.....!

  • How can i use jpg extension with forms 10g and webutil

    I have a form with webutil and i want to open imege jpg extension but thier are Bmp but my
    image jpg and image item has no jpg extension .
    How can i use jpg extension with forms 10g and webutil ?

    You can use the JFIF image format for jpg files.

Maybe you are looking for