Java and Javascript

I am in the process of a doing my final year project. I have to make an Interactive Guide. I am going to use SQL for the database and then use Java to interact with the database. I would like advice on and if people know of any good sources on where I can find good information on how to get Java to interact with Javascript. I have looked at other interactive guide websites and found that they use Javascript but upon viewing the source code I am unable to work out how they get them to interact.
Secondly I was wondering if I could be pointed to a good source of information or if people can pass on advice on how to create a good login system.
Thank you.
Tim

msc85tjm wrote:
I am in the process of a doing my final year project. I have to make an Interactive Guide. I am going to use SQL for the database and then use Java to interact with the database. I would like advice on and if people know of any good sources on where I can find good information on how to get Java to interact with Javascript. I have looked at other interactive guide websites and found that they use Javascript but upon viewing the source code I am unable to work out how they get them to interact.
Secondly I was wondering if I could be pointed to a good source of information or if people can pass on advice on how to create a good login system.
Thank you.
TimDefine, "interact with java." Are you talking AJAX? Not too sure what you meant by that.
And what do you mean by "good" login system. What's "good" to me may not be "good" to you. What does it need to do, how secure does it need to be, what are your implementation restrictions, etc....

Similar Messages

  • Error using java and javascript

    I have a jsp page that links to a bean and is working fine (getting data from the database).
    On a html form I have a button with a picture that fires off javascript when clicked:
    <BUTTON TYPE=reset onclick=showinfo('<%=index%>')>
    <IMG SRC="http://localhost:8080/Portal/Images/q2.bmp" ALT="Info">
    </BUTTON>
    The javascript function just opens a new window and displays the text sent in:
    <Script Language=JavaScript>
    function showinfo(arrayindex)
    InfoWin=window.open("","InfoWin","width=345,height=220");
    InfoWin.document.write(arrayindex);
    return false;
    </Script>
    Well in the above example index is a number (pulled from the database using a java bean and javascript converts it into a string then the function displays it correctly. If I replace <%=index%> with regular text it works fine as well(because java isn't used to pull data)! The problem occurs when I retrieve text data from the database and send it to the function. The web page gives errors about a nonterminating string. But I can move the code to somewhere else on the form(as long as I don't send it to java script) and it will print the text to the screen. I can also view the source of the web page and the html shows the text from the data base as if I hard coded the text into the javascript!!!!!!!!!!!!!!!!!
    This must be a bug between java and javascript!
    -can pass numbers(from a database) between the two
    -can't pass text (from a database)between the two
    Any info would help!

    Found the problem myself!
    I am using an odbc connection to msaccess and the spaces in the text was messing things up!
    After taking out the spaces it worked again.

  • What's the difference between java and Javascript?

    I a new programer, I am getting Java down. Now I want to add some java scripts to my site. Is there any difference between java and Javascript? Can I use the Java API site refference and classes? Thanks..

    Java is a programming language, Javascript is more for web pages. It is used to add interactivity to your web pages. 2 different languages.
    check out www.java.sun.com for Sun Java stuff.
    Lynn

  • Java and javascript cookies

    Hi
    i create a cookie called "SaveState" from javascript in my JSP dynpage.
    I want to read this from java (NOT JAVASCRIPT).
    Is this possible?
    if not, is there some kind of portal memory I can use to pass values between java and javascript?
    thanks
    Anton Kruse

    Hi,
    <b>Domain</b>
    The "domain" parameter is used to set the domain the cookie is accessable to. A path can be set for your own domain only and the domain path must include at least two periods (.domain.com). It must match your server's domain name. Therefore cookies are not a security risk since only the server that sets them can use them.
    Check this to know more about cookies:
    http://www.comptechdoc.org/independent/web/cgi/javamanual/javacookie.html
    If you still have questions, I will suggest to google on cookies.
    Greetings,
    Praveen Gudapati

  • Java and Javascript together?

    I am a moderately new Java programmer and I was wondering if anyone knew how to use java to connect to the internet then access a Javascript function on that page. Any help would be greatly appreciated.

    Unless it's necessary, you could use the validate in the ActionFormBean of using struts instead of the Javascript. You will have to create a methode called validate of the type ActionError. You should look into the Struts example Application, they do a simple Validation on the User name and password. This is how I'm doing the validation using struts.
    It return any message that you put in your applicationRessource.properties file back to where you put the tag <html:error/> in you jsp/Struts page. It does the validation before it it execute the action. It's kinda cool, plus you don't have those anoying alert popup windows that way.
    good luck

  • How is the length of a string calculated in Java?  and JavaScript?

    Hi all,
    Do any of you know how the length of a string is being calculated in Java and JavaScript? For example, a regular char is just counted as 1 char, but sometimes other chars such as CR, LF, and CR LF are counted as two. I know there are differences in the way Java and JavaScript calculate the length of a string, but I can't find any sort of "rules" on those anywhere online.
    Thanks,
    Yim

    What's Unicode 4 got to do with it? 1 characteris 1
    character is 1 character.
    strings now contain (and Java chars also) is
    UTF-16 code units rather than Unicode characters
    or
    code points. Unicode characters outside the BMPare
    encoded in Java as two or more code units. So it would seem that in some cases, a single
    "character" on the screen, will require two charsto
    represent it.So... you're saying that String.length() doesn't
    account for that? That sux. I don't know. I'm just making infrerences (==WAGs) based on what DrClap said.
    I assume it would return the number of chars in the array, rather than the number of symbols (glyphs?) this translates into. But I might have it bass ackwards.

  • Problem of Java - javascript and javascript - java communicate of same obje

    Hi all,
    I have met a great problem in program an applet! I have tried to communicate between java and javascript and javascript and java in the same page by using jsobject. However, problem occur. It is not a problem to call javascript from java by using jsobject. However, javascript call java by using document.object.function has problem. It cannot find out the object in IE. I have followed the webpage show in java, but the browser still prompt me the object called client not find. Please help!! My html code is shown as follow:
    <HTML>
    <HEAD>
    <TITLE>Alva Final Year Project Demo</TITLE>
    </HEAD>
    <Script language="javaScript">
    function show(html){
    layer.innerHTML = html;
    function getResponse(response){
    alert("response: " + response);
    document.client.getJSCommunicate();
    </Script>
    <BODY>
    <DIV id="layer" style="position:absolute">
    <H2>Secure Server</H2>
    <HR>
    <!--"CONVERTED_APPLET"-->
    <!-- CONVERTER VERSION 1.0 -->
    <OBJECT id="client" classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
    WIDTH = "800" HEIGHT = "400" codebase="http://java.sun.com/products/plugin/1.1.1/jinstall-111-win32.cab#Version=1,1,1,0">
    <PARAM NAME = CODE VALUE = "ClientPart.class" >
    <PARAM NAME="SCRIPTABLE" VALUE="true">
    <PARAM NAME="MAYSCRIPT" VALUE="true">
    <PARAM NAME="type" VALUE="application/x-java-applet;version=1.1">
    <COMMENT>
    <EMBED type="application/x-java-applet;version=1.1" java_CODE = "ClientPart.class" NAME = "client" WIDTH = "800" HEIGHT = "400" pluginspage="http://java.sun.com/products/plugin/1.1.1/plugin-install.html"><NOEMBED></COMMENT>
    </NOEMBED></EMBED>
    </OBJECT>
    <!--
    <APPLET CODE = "ClientPart.class" WIDTH = "800" HEIGHT = "400" NAME = "clientPart" >
    </APPLET>
    -->
    <!--"END_CONVERTED_APPLET"-->
    </DIV>
    </BODY>
    </HTML>
    Thanks your kindly help.
    Alva

    Everthing looks fine to me from here, you should be able to just call the java function direct such as
    document.myAppletObj.doMethod();
    I think your problem could be that your object is called "client". IE can get funny about names, it didn't like me calling a method delete()!!
    Try adding something else to the name such as "my_client", and see if this works any better.
    Chris

  • Java vs Javascript NOT THE SAME THING

    Since we're all just users here it might be appropriate to remind people that Java and Javascript are two distinctly different things. With the recent warnings about Java some might be inclined to also disable Javascript in their browsers. There is no need to do that.
    Even thought the two frameworks have similar names they are not related.

    drcouzelis wrote:
    grabbexi wrote:I want to understand Unix/Linux better
    Which aspect of Unix / Linux do you want to understand better?
    Options include:
    Networking
    Servers
    System administration (user accounts, permissions)
    Software development
    Package management
    Differences between distributions / operating systems
    Kernel compiling
    The Linux Standard Base (LSB)
    Shared libraries
    Version control software
    Embedded linux
    The init process, boot manager, and dual booting
    File systems
    And other stuff.
    I was thinking a basic mix of everthing above, basically. Like: What are libraries? How does the system administration work? How does the kernel work? Etc. I mean - the answers are often not so complicated to understand on a basic level. My problem is, I don't know what questions to ask.
    I think I'm looking for some "tasks" which don't require a lot of time, I don't really HAVE the need to do extremely much on my Arch - but I would love to be ABLE to do more.
    bohoomil wrote:Well, I believe you mean 'using a particular Linux distribution' in the first place.
    Yes, you are right - that is what I meant.
    General response: Thanks to all of you so far. I'm starting to understand what I should do, just hoping I'm on the right track now.

  • Java and flash wont work

    I went to try out the new icloud but when i logged in it said i needed java to run this. I have check the software update and everything is up to date so the computer 'thinks' java is working fine but it simply isnt there.
    Also another thing i am also having this same problem with adobe flash. Not sure if there connected some how but neither of them work and the computer thinks they are already installed

    You should check that you've got Java and Javascript turned on in Safari preferences:
    Safari menu > Preferences.. > Security tab
    Bob

  • New to Java and stuck on alert ticker issue

    Hi, I'm a newbee so go easy on me. Here's the issue. The company I am interning for monitors its networks using a console called WhatsUp Gold. The program creates alerts to inform of any issues on the network or when thresholds are close to being reached. This is done using some form of Java which I can view by opening the source files. They have asked me to try and create a scrolling ticker that automatically updates in real time along with the WhatsUp program. I have downloaded INSCRO (a ticker creator) but when I try to direct the feed to the URL on WhatsUp, the ticker scrolls the Java script and not the text that I need it to. Any ideas on how to get it to pull the text vs the source file?
    Thanks in advance!

    First, you need to get straight the difference between Java and JavaScript. They're related only by having similar names. If you're doing "View Source" in a web browser, what you're seeing is JavaScript, NOT Java. If this is where your question lies, you need to find a JavaScript forum.

  • Java to javascript problems with '

    I have a class that pass some strings to a javascript alert(<....>)
    In this sting I have some < ' > and when I launch the class I get always an alert with the ASCII code of < ' >.
    I used this syntax inside the String
    String alertSctring="Let \' go";
    but I get
    Let &#39 go
    Why?

    I'm sure the problem has to do with escaping values in strings in Java and Javascript.
    Try using double-backslash quote.. like "Let \\' Go"

  • 1.6.0_10 and 11, Memory leak returning variables from Java to JavaScript

    Environment: Windows XP SP2, IE7, JScript 5.7, JRE 1.6.0_11-b03 and 1.6.0_10
    Memory allocated in Java and returned as a JavaScript variable value is not garbage collected in Java when the JavaScript variable is re-used.
    In the following simplified example, a populated HashMap is returned from the applet test1 method to the JavaScript variable hash1.
    The JavaScript variable hash1 is re-used on the next iteration so I would expect it should be marked for garbage collection.
    In 1.6.0_7 and previous releases, the memory associated with this Java HashMap is freed implicitly.
    In 1.6.0_10 and 1.6.0_11 the HashMap memory is never freed.
    Is this is what we should expect, a feature of the significant LiveConnect changes that were part of 1.6.0_10?
    Do we need to rewrite our code to call new Java methods from JavaScript explicitly freeing the memory, in this example calling the freeMem method?
    Has anybody else experienced this problem since 1.6.0_10?
    Thanks
    Rob
    Example code ...
    TestRLApplet.java
    import java.applet.Applet;
    import java.util.HashMap;
    public class TestRLApplet extends Applet
    private HashMap hash1;
    public TestRLApplet()
    public void init()
    public HashMap test1()
    hash1 = new HashMap();
    for (int i = 0; i <10; i++) {
    hash1.put(Integer.toString(i),Integer.toString(i));
    return (hash1);
    public void freeMem() {
    hash1.clear();
    hash1 = null;
    TestClient.htm
    <HEAD>
    <TITLE></TITLE>
    <SCRIPT LANGUAGE="javascript">
    function window_onload()
    var hash1;
    testAppplet = document.TestRLApplet;
    for (cnt=0; cnt < 1000; cnt++)
    hash1= testAppplet.test1();
    </SCRIPT>
    </HEAD>
    <object
    classid = "clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
    WIDTH = 1 HEIGHT = 1 NAME = "TestRLApplet" >
    <PARAM NAME = CODE VALUE = "TestRLApplet.class" >
    <PARAM NAME = ARCHIVE VALUE = "../applets/TestRLApplet.jar" >
    <PARAM NAME = NAME VALUE = "TestRLApplet" >
    <PARAM NAME = MAYSCRIPT VALUE = true >
    <param name = "type" value = "application/x-java-applet;version=1.6">
    <param name = "scriptable" value = "false">
    </object>
    <BODY LANGUAGE=javascript onload="return window_onload()" leftMargin=40 id=body >
    </BODY>
    </HTML>
    Java Console
    Java Plug-in 1.6.0_10
    Using JRE version 1.6.0_10 Java HotSpot(TM) Client VM
    c: clear console window
    f: finalize objects on finalization queue
    g: garbage collect
    h: display this help message
    l: dump classloader list
    m: print memory usage
    o: trigger logging
    q: hide console
    r: reload policy configuration
    s: dump system and deployment properties
    t: dump thread list
    v: dump thread stack
    x: clear classloader cache
    0-5: set trace level to <n>
    Memory: 5,056K Free: 2,551K (50%) ... completed.
    Memory: 7,996K Free: 3,499K (43%) ... completed.
    Memory: 7,996K Free: 1,038K (12%) ... completed.
    Memory: 13,180K Free: 3,745K (28%) ... completed.
    Memory: 22,844K Free: 5,614K (24%) ... completed.
    Memory: 37,984K Free: 15,009K (39%) ... completed.
    Memory: 37,984K Free: 13,069K (34%) ... completed.
    Memory: 37,984K Free: 6,125K (16%) ... completed.
    Memory: 65,088K Free: 25,107K (38%) ... completed.
    Memory: 65,088K Free: 21,201K (32%) ... completed.
    Memory: 65,088K Free: 13,381K (20%) ... completed.
    Memory: 65,088K Free: 7,967K (12%) ... completed.
    Memory: 65,088K Free: 5,013K (7%) ... completed.
    Memory: 65,088K Free: 414K (0%) ... completed.

    What are you missing?
    I inherited this app and signing the third party jars is how it was setup, I was wondering the same thing too, why was it necessary to sign the third party jars?
    The applet runs in either JRE 1.6.0_13 or JRE 1.6.0_27 depending on the other Java apps the user uses. JRE 1.6.0_13 does not have the mixed code security (so it is like is disable), but JRE 1.6.0_27 does have the mixed code security and the applet will not launch with mixed code security enable, so we have to disable it. With all the hacking going on in the last two years, is important to improve security; so this is a must.
    Yes, I always clear up the cache.
    Any idea on how to resolve this problem?

  • With Firefox 5.0.1 and Firefox 6 beta there are display problems apparently due to Java and some Javascript compatibility problems -- there were links to solutions, but they are no longer active. What to do?

    The box and button lines are not displayed or are mis-sized, if they appear at all; problem varies with the website and page style.
    The threads I found in discussions mentioned a couple pages that are no longer active/cannot be opened -- so these solutions don't work.
    When starting version 5x and 6beta I get information certain add-ons are STILL incompatible with these versions?
    Are there any work-arounds or patches?

    I am having this problem too. Just like WinOnBatch the problem started for me around firefox 5.0.1.
    I have not been able to get rid of this problem. I have tried creating a new profile, restarting firefox in safe mode. disabling extensions 1 by 1. When I built this computer I did a clean install of firefox 5.0.1, and 2 weeks later with no extensions the problems came back. At that point I had the Java and flash plugins only.
    When firefox 6 was released I did another fresh install (uninstalled firefox, went through my hard disc and deleted any reference to firefox and mozilla. Did the same in the registry, then run a registry cleaner and restarted the computer) before I installed firefox 6 and the problem was happening in less than a week. The I said to hell with it and re-created my entire profile from scratch and installed all my old extensions (updated them off course). 2 weeks ago it got really sever and I couldn't see any buttons on the chome interface and all web pages I visited were displaying really messed up. The only way i can describe it is kinda like greentech70 screenshots but on every inch of the application window. Like a really bad screen tearing effect.
    The only thing that seem to help is when I downgraded to firefox 3.6.18. That fixed it but like greentech70 I have security and privacy concerns, so upgraded to firefox 6 again as the issue went away for 1 day, then came back but not as severe. since then I have been downgrading to firefox 3.6.18 re-installing java and flash, then upgrading back to firefox 6. It keeps the problem minimised but im still plagued by it. I also wonder if its a problem with firefox's 6 graphical engine.

  • Using Quicken to manage a bank account, I get an error message from the bank that cookies and javascript must be enabled, but I don't get that message when I connect with Internet Explorer.

    Firefox allows me to get the bank home page through Quicken. But when I try to login, the error message appears saying "cookies and javascript" must be enabled. I have Java on my system, but in Firefox under "tools/options/ I don't find any way to "enable" javascript. I have enabled "cookies".
    I have no problem logging in at the bank site using Internet Explorer, but to use it, I have to designate it as the "default browser" before connecting through Quicken. I'd rather keep Firefox as the default.
    A bank tech representative was unable to find any commands in Firefox that would deal with this problem, although she clearly had manuals for both Internet Explorer and Firefox. So she concluded that I would have to use Explorer for this operation, since it allowed control of security level settings. She said that in Explorer, security level should be set to medium.
    Is there some similar control in Firefox?

    Firefox uses the same "security level" setting that is set in IE.
    Tools > Options > '''Content''' <br />
    Is '''Enable Javascript''' check-marked?
    http://kb.mozillazine.org/JavaScript_is_not_Java
    If that doesn't solve your problem, do you have that problem when running in the Firefox SafeMode? <br />
    [http://support.mozilla.com/en-US/kb/Safe+Mode] <br />
    ''Don't select anything right now, just use "Continue in SafeMode."''
    If not, see this: <br />
    [http://support.mozilla.com/en-US/kb/troubleshooting+extensions+and+themes]

  • RE: Java and Forte

    We have no problem using JDK 1.1.5. However, we are using Orbixweb. If
    you are accessing the applet and the IOR file from the same host (exact
    host name), then one other possibility is the JVM compatibility for your
    browser. Using Javasoft's Activator or appletviewer should resolve
    that.
    -----Original Message-----
    From: Kamran Amin [SMTP:[email protected]]
    Sent: Tuesday, March 10, 1998 7:48 AM
    To: '[email protected]'; '[email protected]'
    Subject: RE: Java and Forte
    Dan,
    We had the same problem as you are having regarding question
    one. Make
    sure you are
    using JDK 1.1.3 or 1.1.4. It did not work for me when I was using JDK
    1.1.5. Also you have to
    use the gatekeeper to make the applet work. Hope this help.
    Kamran Amin
    Forte Technical Leader, Software Engineering
    [email protected]
    203-459-7362
    Oxford Health Plans
    48 Monroe Turnpike
    CT, Trumbull 06611
    http://www.oxhp.com/
    From: [email protected][SMTP:[email protected]]
    Sent: Monday, March 09, 1998 7:49 PM
    To: [email protected]
    Subject: Re: Java and Forte
    1. I have been able to make my Java client appllication call-in to a
    Forte service object with success. However the tricky part beginswhen
    I try to do the same with a Java applet. I get an exception returned
    which is an AppletSecurityException. I understand that running a Java
    applet in a browser has two limitations, one being the Java applet
    sandbox and the firewall restriction. As I am only running my Java
    applet and the Forte service object on the same node, this rules out
    the latter.
    I have tried running the Gatekeeper from the same directory as myJava
    client application, which includes all the client stub files
    (including stub files which are generated from Forte supplier plans
    such as those in the Framework folder). However, I still receive the
    AppletSecurityException.
    How can I go about making this operation successful?
    **AppletSecurityExceptions can be caused by many problems--trying toaccess
    machines other than the class download machine, or trying to accessserver
    side classes outside the defined directory structure in the webserver. I'd
    look closely at the classes that are being brought into memory (forexample,
    Visibroker's ORB shows you each file as it is loaded) and make sureyour web
    server is defined correctly. If you follow the Forte technotesclosely, it
    usually solves this problem.
    2. Has anyone tried implementing a 'fat' client, one that combines a
    Forte web application, JavaScript, and a Java applet client toperform
    operations such as validation and a tiny bit of data processing allon
    the client side, relieveing the application server from such
    operations? If yes, how do I implement the solution, and are thereany
    tech notes from Forte that specifically tell me how to do this?
    **We have created a Java framework that follows many of the designpatterns
    and naming conventions as our Forte framework. The Java classes canbe
    extended to marshal and unmarshal scalar data structs passed acrossthe ORB
    boundary to instantiate 'thick' functional objects on the client, andas much
    processing and as many business rules as wanted can be developed inthe
    client
    Java objects.

    If you look at the exception information in the iiop manual it
    discusses exteneded propties DefaultThrowsClause, ThrowsClause and
    IsThrowable.
    If you mark your exception class with IsThrowable it will show up in the
    IDL as an exception. If you use either DefaultThrowsClause(project) or
    ThrowsClause(method) you will get the appropriate raises in the idl.
    This will cause the idl2java to produce code which will allow you to catch
    the exception.
    Tom.
    At 09:41 AM 1/29/99 +0100, Giuseppe Sorce wrote:
    >
    Hi all,
    I am currently working to an architecture to establish a communication
    between a Forte' server and a Java client, using Visigenic's Visibroker and
    IDL mode.
    I have problems when I try to raise a Forte' exception from a method
    invoked by the Java client; I would like the exception class
    (ProductException) not to inherit from the class GenericException, because
    the IDL I want to generate must have this structure:
    exception ProductException {
    string message;
    Using this solution, the client application gets blocked waiting forever.
    I am currently working with:
    - Forte' 3.0.G.2 plus WebEnterprise 1.0.B
    - JDK 1.1.5
    - Visibroker 3.1
    My question is: is it possible to raise an exception from the Forte' side
    that is
    compliant to the IDL mentioned above?
    Of course it should be caught from the Java side.
    Thank you in advance
    Giuseppe Sorce
    CSI Piemonte - C.so Unione Sovietica 216 - 10134 Torino - ITALY
    tel. +39-011-3168736
    fax +39-011-3168212
    e-mail [email protected]
    url http://www.csi.it
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

Maybe you are looking for

  • Email a Report -- No Contacts listed

    When I schedule a report to be delivered via email, I don't get any Contacts listed in the listbox for recipients. How can I populate this listbox?

  • Use of deductions field

    HI EXPERTS, what is the use of deductions field (in line items) in the cheque printing . in what scenario it will get triggered . regards siva shanmugam

  • How to set missing language information in iTunes books?

    Some of the ebooks I imported into iTunes are missing language information in their metadata. I can't find a means of setting the proper language in the information dialog, something which can easily done i.e. using Calibre or Sigil. Is iTunes really

  • Price lists

    Good morning. I have a question: I buy my items in US dollars. My currency is Euro. I created a sale price list based on last purchase price. Can I have my sale price list in euro? Which documents update last purchase price? When? Thanks for your ans

  • Tracking the custom table changes

    Hai, plz let me know how to track the changes in custom table? thankyou. Moderator message: please search for available information before asking. locked by: Thomas Zloch on Sep 17, 2010 12:55 PM