Problem using jsp:forward in java script

hi,
when I use jsp forward tag inside java script i'm getting a problem that
when the jsp is invoked it is getting forwarded to the page specified in the forward tag, without checking the if conditions. Following code may give you a better idea.
<html>
<script>
function test()
if(document.f.htemp.value=="true")
alert("jus");
else
var s=document.f.htemp.value;
alert(s);
<jsp:forward page="success.jsp" />
</script>
<body>
<form name="f" method=post>
<input type=text name=htemp value="true">
<input type=button onclick="test()">
</form>
</body>
</html>
please help me,thanks inadvance
regards
chandu

What pgeuens means is that you can't mix javascript and jsp/java code in this way.
ALL of the jsp/java code gets executed at the server end.
This produces an HTML page (with embedded javascript) which gets sent to the client.
The client then runs javascript code in response to events (onLoad, onClick, onChange etc etc)
So in this case, the jsp:forward will always be executed, because as far as the server is concerned, the javascript is just template text.
If you WANT to do a conditional forwarding on the server side you do it in java ie (horribly using scriptlet)
<%
if (testCondition){
%>
  <jsp:forward>
%<
%>Or if you want to test what the client has entered client side, all you can do is submit the form, or navigate to a URL
<script>
function test()
if(document.f.htemp.value=="true")
alert("jus");
else
var s=document.f.htemp.value;
alert(s);
document.f1.action="success.jsp";
document.f.submit();
</script>You cannot run JSP code based on your javascript code.
Java. Javascript. Not the same thing.
Hope this helps,
evnafets

Similar Messages

  • Using JSP variable inside Java Script's alert function.

    Hi Gurus,
    We are trying to use alert function with one of the string variables populated inside JSP code, but its not working.
    Here is the code snippet, please advice.
         <%
         oracle.apps.qot.util.RequestCtx.log("qotcustom.jsp",AOLMessageManager.getMessageSt(QotUtil.QOT_APPS_CODE, "XDPYY_DISC"));
         %>
         var alert_text="<%=AOLMessageManager.getMessageSt(QotUtil.QOT_APPS_CODE, "XDPYY_DISC")%>";
         alert(alert_text);
         Here in the first line we are using API to get text message defined in database, the line is getting executed properly and we could see output text message in debug log file, after this in the 4th line, we are assiging this string output of API to java script variable alert_text and further using alert function with the variable alert_text as argument. But alert function is failing, no errors are thown in debug log file.
    Please advice whether we are doing any thing wrong.
    Thanks in advance.

    What pgeuens means is that you can't mix javascript and jsp/java code in this way.
    ALL of the jsp/java code gets executed at the server end.
    This produces an HTML page (with embedded javascript) which gets sent to the client.
    The client then runs javascript code in response to events (onLoad, onClick, onChange etc etc)
    So in this case, the jsp:forward will always be executed, because as far as the server is concerned, the javascript is just template text.
    If you WANT to do a conditional forwarding on the server side you do it in java ie (horribly using scriptlet)
    <%
    if (testCondition){
    %>
      <jsp:forward>
    %<
    %>Or if you want to test what the client has entered client side, all you can do is submit the form, or navigate to a URL
    <script>
    function test()
    if(document.f.htemp.value=="true")
    alert("jus");
    else
    var s=document.f.htemp.value;
    alert(s);
    document.f1.action="success.jsp";
    document.f.submit();
    </script>You cannot run JSP code based on your javascript code.
    Java. Javascript. Not the same thing.
    Hope this helps,
    evnafets

  • Problem using jsp:include from inside a custom tag

    Hi, All !
              I have a problem using <jsp:include> from inside a custom tag. Exception is:
              "java.lang.ClassCastException: weblogic.servlet.jsp.BodyContentImpl"
              Apparently, weblogic tries to cast BodyContentImpl to JspWriterImpl and
              could not do this. Is it a bug, since in the 1.1 spec is said: "The
              BodyContent is a subclass of JspWriter that can be used to process body
              evaluations so they can retrieved later on."
              My code is:
              <wfmklist:items>
              <jsp:include page="item.jsp" flush="true"/>
              </wfmklist:items>
              

    This is an area of contention with WL. It is not so tolerant with regards to
              the spec. I spent several days recently trying to convince it to accept the
              specification in regards to bodies and includes and it appears to have
              successfully rebuffed my efforts.
              Frankly, this is very disappointing. It appears that some shortcuts were
              taken on the way to JSP 1.1 support, and the result is a very hard-coded,
              inflexible implementation. As I have not seen the implementation myself, I
              hate to assume this, however one could posit that the term "interface" was a
              foreign concept during the implementation, other than as some annoying
              intermediary reference requiring an immediate cast to a specific Weblogic
              class, which in turn is apparently required to be final or have many final
              methods, as if being optimized for a JDK 1.02 JIT.
              I am sorry that I don't have any positive suggestions other than to use a
              URL object to come back in an execute the necessary "include" directly. You
              lose all context (other than session) and that can cause its own problems.
              However, you can generally get the URL approach to work, and you will
              hopefully avoid further frustration.
              Peace,
              Cameron Purdy
              Tangosol, Inc.
              http://www.tangosol.com
              Tangosol: How Weblogic applications are customized
              "Denis" <[email protected]> wrote in message
              news:[email protected]...
              > Hi, All !
              > I have a problem using <jsp:include> from inside a custom tag. Exception
              is:
              > "java.lang.ClassCastException: weblogic.servlet.jsp.BodyContentImpl"
              >
              > Apparently, weblogic tries to cast BodyContentImpl to JspWriterImpl and
              > could not do this. Is it a bug, since in the 1.1 spec is said: "The
              > BodyContent is a subclass of JspWriter that can be used to process body
              > evaluations so they can retrieved later on."
              >
              > My code is:
              > ...
              > <wfmklist:items>
              > <jsp:include page="item.jsp" flush="true"/>
              > </wfmklist:items>
              > ...
              

  • Someone is using faebook to run java script to get data and email from me in windows 8

    someone is using faebook to run java script  to get  data  and  email  from  me in  windows  8

    Is this a developer question?
    Jeff Sanders (MSFT)
    @jsandersrocks - Windows Store Developer Solutions
    @WSDevSol
    Getting Started With Windows Azure Mobile Services development?
    Click here
    Getting Started With Windows Phone or Store app development?
    Click here
    My Team Blog: Windows Store & Phone Developer Solutions
    My Blog: Http Client Protocol Issues (and other fun stuff I support)

  • Filter problem with jsp:forward

    Greetings,
    I was trying to implement compression filter in oc4j. Basically wrap a HttpResponseServletResponseWrapper using a GZipOutputStream for supported browsers. However whenever for eg: I have a.jsp which does jsp:forward page =b.jsp I can see in TCP monitor IllegalStateException response already committed. But I dont see any stack trace in server logs. The buffer size is 2048 and I am pretty sure it did not get filled up before the forward. I would appreciate if anybody has seen such behavior using wrapped response in OC4j(the same code works fine in tomcat and websphere). Also one thing I observed is that for every jsp:include the filter is being called (to handle this I create the wrapper if its not already there and maintain entry count into filter and decrement when I exit filter and finish gzip response when entry count become 0,which works fine). I believe that this is not a part of 2.3 spec.Even in 2.4 spec if the filter config in web.xml is not set to any value by default the filter is supposed to be in request scope. I really appreciate any pointers in resolving this

    I am pasting the stack trace for broken pipe exception. Please let me know if anybody knows the resolution. Please let me know if there is any other way to enable compression of jsp in oc4j in 9 version. The same code works in Jboss/tomacat websphere ! Also from the stack trace we can see that filter is being called for each forward and its not as per 2.3 servlet specification. Even in 2.4 by default the filter is supposed to work at request level.
    Also I have another question oc4j seems to be using hard coded value: if length is more than 100k or so it uses Transfer-Encoding chunked. Is there any clean way of disabling this behaviour for .js files? the reason is for some reason Internet explore does not cache the javascript files properly (sporadically ) when chunked response is used for javascript files.
    4/26/06 4:58 PM: com.evermind.server.http.HttpIOException: Broken pipe
    4/26/06 4:58 PM: at com.evermind.server.http.EvermindServletOutputStream.flush(EvermindServletOutputStream.java:286)
    4/26/06 4:58 PM: at java.io.FilterOutputStream.flush(FilterOutputStream.java:121)
    4/26/06 4:58 PM: at filters.gzip.GzipServletResponseStream.flush(GzipServletResponseStream.java:151)
    4/26/06 4:58 PM: at filters.gzip.GZipServletResponseWrapper.flushBuffer(GZipServletResponseWrapper.java:127)
    4/26/06 4:58 PM: at com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:244)
    4/26/06 4:58 PM: at com.evermind.server.http.GetParametersRequestDispatcher.forward(GetParametersRequestDispatcher.java:189)
    4/26/06 4:58 PM: at com.evermind.server.http.EvermindPageContext.forward(EvermindPageContext.java:199)
    4/26/06 4:58 PM: at SecondPage.jspService(_SecondPage.java:83)
    4/26/06 4:58 PM: at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
    4/26/06 4:58 PM: at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
    4/26/06 4:58 PM: at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
    4/26/06 4:58 PM: at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
    4/26/06 4:58 PM: at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    4/26/06 4:58 PM: at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
    4/26/06 4:58 PM: at filters.CookieFilter.processRequest(CookieFilter.java:522)
    4/26/06 4:58 PM: at filters.CookieFilter.validateRequest(CookieFilter.java:127)
    4/26/06 4:58 PM: at filters.CookieFilter.doFilter(CookieFilter.java:51)
    4/26/06 4:58 PM: at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
    4/26/06 4:58 PM: at filters.gzip.GZipFilter.doFilter(GZipFilter.java:176)
    4/26/06 4:58 PM: at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:556)
    4/26/06 4:58 PM: at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
    4/26/06 4:58 PM: at com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:240)
    4/26/06 4:58 PM: at com.evermind.server.http.GetParametersRequestDispatcher.forward(GetParametersRequestDispatcher.java:189)
    4/26/06 4:58 PM: at com.evermind.server.http.EvermindPageContext.forward(EvermindPageContext.java:199)
    4/26/06 4:58 PM: at FirstPage.jspService(_FirstPage.java:131)
    4/26/06 4:58 PM: at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
    4/26/06 4:58 PM: at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
    4/26/06 4:58 PM: at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
    4/26/06 4:58 PM: at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
    4/26/06 4:58 PM: at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    4/26/06 4:58 PM: at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
    4/26/06 4:58 PM: at filters.CookieFilter.processRequest(CookieFilter.java:522)
    4/26/06 4:58 PM: at filters.CookieFilter.validateRequest(CookieFilter.java:127)
    4/26/06 4:58 PM: at filters.CookieFilter.doFilter(CookieFilter.java:51)
    4/26/06 4:58 PM: at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
    4/26/06 4:58 PM: at filters.gzip.GZipFilter.doFilter(GZipFilter.java:176)
    4/26/06 4:58 PM: at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:556)
    4/26/06 4:58 PM: at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
    4/26/06 4:58 PM: at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
    4/26/06 4:58 PM: at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
    4/26/06 4:58 PM: at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
    4/26/06 4:58 PM: at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
    4/26/06 4:58 PM: at java.lang.Thread.run(Thread.java:479)

  • Using XML file in Java script to create Google Map

    Hello,
    I work for a non-profit in San Diego as a GIS Specialist. I have had to teach myself about some scripting to create some dynamic maps, but I am still very limited in my skills, so I have had to explore the internet in order to discover various tutorials and examples that have led me on a positive path.
    Right now I am working on a Google Mash-Up that will incorporate over 14,000 records, which will appear as separate markers that will have pop-up info bubbles with additional info inside (using html), once the marker is clicked.
    Here is the XML script example that is used in the tutorial I am following:
    <markers>
    <marker lat="43.65654" lng="-79.90138" html="Some stuff to display in the<br>First Info Window"
    label="Marker One" />
    <marker lat="43.91892" lng="-78.89231" html="Some stuff to display in the<br>Second Info Window"
    label="Marker Two" />
    <marker lat="43.82589" lng="-79.10040" html="Some stuff to display in the<br>Third Info Window"
    label="Marker Three" />
    </markers>
    ...and this is how it looks when the file is retrieved by the java script and mapped: http://econym.googlepages.com/example_map3.htm
    This is the java script that creates the Google Map. I have emboldened the section of the script that retrieves the data and parses it to create the markers:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>Google Maps</title>
    <script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAA6GoL8P5zqjQlG5A5uM1ETBSUPozAscB0cY3RG8xEGnZyeom4axRySak889rVpvHYRsV4f9OZZzbboA"
    type="text/javascript"></script>
    </head>
    <body onunload="GUnload()">
    <!-- you can use tables or divs for the overall layout -->
    <table border=1>
    <tr>
    <td>
    <div id="map" style="width: 800px; height: 1200px"></div>
    </td>
    <td width = 200 valign="top" style="text-decoration: underline; color: #4444ff;">
    <div id="side_bar"></div>
    </td>
    </tr>
    </table>
    <noscript><b>JavaScript must be enabled in order for you to use Google Maps.</b>
    However, it seems JavaScript is either disabled or not supported by your browser.
    To view Google Maps, enable JavaScript by changing your browser options, and then
    try again.
    </noscript>
    <script type="text/javascript">
    //<![CDATA[
    if (GBrowserIsCompatible()) {
    // this variable will collect the html which will eventualkly be placed in the side_bar
    var side_bar_html = "";
    // arrays to hold copies of the markers used by the side_bar
    // because the function closure trick doesnt work there
    var gmarkers = [];
    var i = 0;
    // A function to create the marker and set up the event window
    function createMarker(point,name,html) {
    var marker = new GMarker(point);
    GEvent.addListener(marker, "click", function() {
    marker.openInfoWindowHtml(html);
    // save the info we need to use later for the side_bar
    gmarkers[i] = marker;
    // add a line to the side_bar html
    side_bar_html += '<a href="javascript:myclick(' + i + ')">' + name + '</a><br>';
    i++;
    return marker;
    // This function picks up the click and opens the corresponding info window
    function myclick(i) {
    GEvent.trigger(gmarkers, "click");
    // create the map
    var map = new GMap2(document.getElementById("map"));
    map.addControl(new GLargeMapControl());
    map.addControl(new GMapTypeControl());
    map.setCenter(new GLatLng( 37.251699,-119.604315), 7);
    *// Read the data from testXML2blackpoolformat.xml*
    var request = GXmlHttp.create();
    request.open("GET", "testXML2blackpoolformat.xml", true);
    *request.onreadystatechange = function() {*
    *if (request.readyState == 4) {*
    var xmlDoc = GXml.parse(request.responseText);
    *// obtain the array of markers and loop through it*
    var markers = xmlDoc.documentElement.getElementsByTagName("ConnectoryRecord");
    *for (var i = 0; i < markers.length; i++) {*
    *// obtain the attribues of each marker*
    *var lat = parseFloat(markers[i].getAttribute("lat"));*
    *var lng = parseFloat(markers[i].getAttribute("lng"));*
    var point = new GLatLng(lat,lng);
    *var html = markers[i].getAttribute("html");*
    *var label = markers[i].getAttribute("label");*
    *// create the marker*
    var marker = createMarker(point,label,html);
    map.addOverlay(marker);
    // put the assembled side_bar_html contents into the side_bar div
    document.getElementById("side_bar").innerHTML = side_bar_html;
    request.send(null);
    else {
    alert("Sorry, the Google Maps API is not compatible with this browser");
    // This Javascript is based on code provided by the
    // Blackpool Community Church Javascript Team
    // http://www.commchurch.freeserve.co.uk/
    // http://econym.googlepages.com/index.htm
    //]]>
    </script>
    </body>
    </html>
    Here is my delima--
    This is the xml format that I need to use because it can accept the rest of my excel file and loop it through the 14,000+ records to create a functioning xml file. This is just a sample (2 records) of the larger file:
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    <ConnectoryAug2008>
    <ConnectoryRecord>
         <lng>-117.03683</lng>
         <lat>32.944505</lat>
         <ConnectoryID>1</ConnectoryID>
         <Name>$2.95 Guys</Name>
         <StreetAddress>13750 Stowe Drive</StreetAddress>
         <City>Poway</City>
         <State>CA</State>
         <Zip>92064</Zip>
    <Marker>White</Marker>
         <IndustryGroup>Technical Services</IndustryGroup>
         <ConnectoryProfileLink>http://connectory.com/search/profile_view.aspx?connectoryId=1</ConnectoryProfileLink>
    </ConnectoryRecord>
    <ConnectoryRecord>
         <lng>-117.272843</lng>
         <lat>33.13337</lat>
         <ConnectoryID>2</ConnectoryID>
         <Name>(GLDS) Great Lakes Data Systems</Name>
         <StreetAddress>5954 Priestly Drive</StreetAddress>
         <City>Carlsbad</City>
         <State>CA</State>
         <Zip>92008</Zip>
    <Marker>Orange</Marker>
         <IndustryGroup>Technology</IndustryGroup>
         <ConnectoryProfileLink>http://connectory.com/search/profile_view.aspx?connectoryId=2</ConnectoryProfileLink>
    </ConnectoryRecord>
    </ConnectoryAug2008>
    This is the tutorial where I found the formatting techniques to successfully create the large xml file that will format/convert my excel file properly: http://www.mrexcel.com/tip064.shtml
    These variables should appear as html in the info bubble:
    <ConnectoryID>2</ConnectoryID>
         <Name>(GLDS) Great Lakes Data Systems</Name>
         <StreetAddress>5954 Priestly Drive</StreetAddress>
         <City>Carlsbad</City>
         <State>CA</State>
         <Zip>92008</Zip>
    <IndustryGroup>Technology</IndustryGroup>
         <ConnectoryProfileLink>http://connectory.com/search/profile_view.aspx?connectoryId=2</ConnectoryProfileLink>
    The "Marker" variable instructs Google Maps to label the marker with a particular color. I will be so grateful to the person(s) that helps me get through this wall that I have been hitting for a long time. It's very difficult without having the luxury of peers who know about these types of issues.
    Thank you!!

    Here is the relationship: They both contain geographic coordinates that produce a point on a map. I will use the rest of the information in the second xml file (company name, address, link, etc.) to produce the information for the bubble that will pop up once the marker is clicked.
    My problem is that I need to try to keep the second xml file in a relatively similar format, so the rest of my records will still be accepted. If I had a smaller amount of records I could place them directly into the javascript, but because there are so many records, I need to use an xml file that can be retrieved by the java script. I chose to use the second type of xml file because I can easily copy and past the 14,000+ records that are now in excel document.
    After the xml issue is corrected I need to rework the javascript that is now emboldened so that it will read the new xml file correctly. I included the first xml file so that the readers will understand what type of xml format is currently being used to produce the markers in the tutorial map.

  • Problem in jsp:forward

    hi,
    i have a jsp page from where i have to call my servlet.but it is mapped in xml by other name.so what should i do?can i call that servlet using named mapped into the xml.
    can i do this?
    <jsp:forward page="/servlet/web.xml mapping"></jsp:forward>
    it's urgent.
    so please help me.
    kamlesh solanki

    hey man,
    how u doin?
    your problem is quite funny. here in servlet configuration in the xml file there is what we call servlet mapping<servlet-mapping>.
    here is how we map a servlet to a kind of url:
    <servlet-mapping>
    <servlet-name>
    havet
    <servlet-name>
    <url-pattern>
    /havva.jspa
    </url-pattern>
    </servlet-mapping>
    nbow when calling this servlet using this url pattern it now behaves as if its in the main application directory just like where jsps are so u will forward to it like a jsp.
    thats the shizzy.
    ok call it like this now
    <jsp:forward page="havva.jspa" />
    or
    <jsp:forward page="havva.jspa"></jsp:forward>
    since u may be used to this style of calling the tag.
    stay cool and let me know if u had any problems.

  • Using jsp variable in java code

    Hey guys,
    I need some help hope you guys can help me.
    I've declared a variable "error" in a jsp. how do I access this variable in the java code whice resides in the same jsp page.
    I know I can use java variable in jsp code using
    <%= sVariable %>
    where sVariable was declared in the java code. but how do I access a jsp variable in java code??
    Thanks very much in advance

    Thanks for the reply.
    This is what I want to do.
    I've declared a variable "error" using <c:catch var="error">I want to check the value of this variable and suppose if it contains XYZ (error variable will have a long string so I just want to check if it contains a specific value) I want to do step1 and if the variable of error is not XYZ I want to do step 2
    Problem is I dont know how to check if error contains the XYZ in jsp thats why I thought java code would help here.
    Can you guys suggest a better way to solve my problem.
    Thanks again

  • How to use jsp:forward

    I would like to show my code, because i'm not sure what u mean at the moment...i want to display the error message on the registration.jsp page and not on a new page...
    registration.jsp:
    <HTML>
    <HEAD>
    <TITLE>New Player</TITLE>
    <content = "registration.html">
    <LINK REL=stylesheet TYPE="text/css" HREF="style.css">
    <SCRIPT>
    function validateText(regForm)
    if(regForm.firstName.value=="")
    return false;
    if(regForm.surname.value=="")
    return false;
    if(regForm.email.value=="")
    return false;
    if(regForm.teamName.value=="")
    return false;
    if(regForm.pass1.value=="")
    return false;
    if(regForm.pass2.value=="")
    return false;
    return true;
    function validatePass(regForm)
    if(regForm.pass1.value!==regForm.pass2.value)
    return false;
    return true;
    function validatePassw(regForm)
    var pWord = regForm.pass1.value;
    if(pWord.length > 8)
    return false;
    else if(pWord.length < 4)
    return false;
    return true;
    function validateTeamn(regForm)
    var tName = regForm.teamName.value;
    if(tName.length > 15)
    return false;
    return true;
    function validateEmail(email)
    var result = false
    var theStr = new String(email)
    var index = theStr.indexOf("@");
    if (index > 0)
    var pindex = theStr.indexOf(".",index);
    if ((pindex > index+1) && (theStr.length > pindex+1))
    result = true;
    return result;
    function doSubmit(regForm)
    if(validateText(regForm)==false)
    alert("Please complete all text fields");
    return false;
    else if (!validateEmail(regForm.email.value))
    alert("Please enter email address in the form: [email protected]");
    return false;
    else if(validateTeamn(regForm)==false)
    alert("Team Name too long");
    return false;
    else if(validatePass(regForm)==false)
    alert("Passwords did not match, please retype password");
    return false;
    else if(validatePassw(regForm)==false)
    alert("Incorrect password length, please retype password");
    return false;
    //alert("Your details are being submitted");
    //return;
    </SCRIPT>
    </HEAD>
    <BODY>
    <FONT size=4>
    Please enter the following information in the space provided below:
    </FONT>
    <CENTER>
    <FORM NAME="regForm" ACTION="confirm.jsp" METHOD=POST onSubmit="return doSubmit(regForm);">
    <B><U>Personal Details:</U></B><BR>
    <FONT SIZE=2 color="blue">(Your Team Name should be no more than 15 characters long<BR>
    & Your Password should be between 4-8 characters)</FONT><BR>
    <TABLE>
    <TR>
    <TD ALIGN="right">
    First Name:
    </TD>
    <TD ALIGN="left">
    <INPUT TYPE="text" SIZE=20 NAME="firstName">
    </TD>
    </TR>
    <TR>
    <TD ALIGN="right">
    Surname:
    </TD>
    <TD ALIGN="left">
    <INPUT TYPE="text" SIZE=20 NAME="surname">
    </TD>
    </TR>
    <TR>
    <TD ALIGN="right">
    Email Address:
    </TD>
    <TD ALIGN="left">
    <INPUT TYPE="text" SIZE=20 NAME="email">
    </TD>
    </TR>
    <TR>
    <TD ALIGN="right">
    Team Name:
    </TD>
    <TD ALIGN="left">
    <INPUT TYPE="text" SIZE=20 MAXLENGTH=30 NAME="teamName">
    </TD>
    </TR>
    <TR>
    <TD ALIGN="right">
    Password:
    </TD>
    <TD ALIGN="left">
    <INPUT TYPE="password" SIZE=8 MAXLENGTH=20 NAME="pass1">
    </TD>
    </TR>
    <TR>
    <TD ALIGN="right">
    Re-enter Password:
    </TD>
    <TD ALIGN="left">
    <INPUT TYPE="password" SIZE=8 MAXLENGTH=15 NAME="pass2">
    </TD>
    </TR>
    </TABLE>
    <INPUT TYPE="submit" VALUE="Register">
    <INPUT TYPE="reset" VALUE="Clear Form">
    </FORM>
    </CENTER>
    </BODY>
    </HTML>
    confirm.jsp:
    <html>
    <head>
    <basefont face="Arial">
    </head>
    <body>
    <center>
    <%@ page language="java" import="java.sql.*" %>
    <%
    // load driver
    Class.forName("org.postgresql.Driver");
    // create connection url
    String URL = "jdbc:postgresql://dbhost/ug59sxn";
    // pass database parameters to JDBC driver
    Connection Conn = DriverManager.getConnection(URL, "ug59sxn", "hupeswop");
    boolean verify = false;
    String email;
    String email2;
    email = request.getParameter("email");
    // query statement
    Statement SQLStatement = Conn.createStatement();
    // generate query
    String Query = "SELECT email FROM usertable " +
    "WHERE email = '"+email+"'";
    // get result
    ResultSet SQLResult = SQLStatement.executeQuery(Query);
    // check for email
    while(SQLResult.next())
    email2 = SQLResult.getString(1);
    if(email.equalsIgnoreCase(email2))
    verify=true;
    out.println("email already exists, please type another one");
    if(verify==false)
    %>
    <jsp:forward page="reg2.jsp"></jsp:forward>
    <%
    // close connections
    SQLResult.close();
    SQLStatement.close();
    Conn.close();
    %>
    </center>
    </body>
    </html>
    So what u r saying..i should put into my confirm.jsp -
    %>
    <jsp:forward page="registration.jsp">
    <jsp:param name="errorMessage" value="Email already exist" />
    </jsp:forward>
    <%
    but the part where i'm abit confused, what am i supposed to put in the registration.jsp page?
    thanx for the help in advance.

    Hi,
    In confirm.jsp You can put the error message in a header with response.setAttribute(sMsg, "Please type proper values"); or you can put it in session or cookie.
    And get this information in the regestration.jsp and display it.

  • How to write JSP code in Java Script Code

    Hello friends
    I have code like
    <script language="JavaScript">
    function f()
    (some code is here)
    </script>
    Now i wants to put some JSP code in f()
    So can i do this ? IF yes then how ?
    (one solution may be make JSP function and call that JSP function from the f().So in that case how can i call JSP function from JavaScript??
    If other method is there then please mail me

    If it's a simple matter of mixing client-side code with server side code, it can be done so long as you're using the server-side to write the client-side.
    For example:
    <h1>Good Morning Mr. Phelps</h1>
    <input name=anybodyFunction type=text>
    <% if (userIsAdmin) { %>
    <input name=adminOnlyFunction type=text>
    etc.
    <% } %>
    <h1>This browser will self-destruct in ...</h1>
    That's JSP (inside the <% %>) mixed with HTML.
    Javascript goes 100% on the client-side. If you're writing JSP with inter-mixed HTML, you might have to inter-mix the java-script.
    For example: Suppose you need to validate the form. "adminOnlyFunction", among others, is a mandatory field, and you want the Javascript to only submit the form if all mandatory fields are set. Well, if the user is NOT an administrator, then that field WILL be left blank.
    One way to handle that is with mixing JSP/HTML/Javascript on the SERVER side.
    <h1>Good Morning Mr. Phelps</h1>
    <input name=mandatory1 type=text>
    <input name=optional1 type=text>
    <% if (userIsAdmin) { %>
    <input name=adminOnlyFunction type=text>
    <% } %>
    <input name=submit type=button value=Submit onClick="checkit()">
    etc. etc.
    <script language=Javascript>
    function checkit() {
    var f = document.form;
    if (
    � � f.mandatory1.value == ""
    � � || f.mandatory1.value == ""
    � � || f.mandatory2.value == ""
    <% if (userIsAdmin) { %>
    � � || f.adminOnlyFunction.value == ""
    <% } %>
    � � � � ) {alert ("Hey! You left out a required field!!");}
    etc. etc. etc.
    I imagine THIS might be what is meant by "mixing JSP with Javascript", and in this particular fashion, it can be done. What you're doing is making decisions on the server side over what to write out to the client. That client code can make further decisions based on user input.
    However, once it's on the client side, you can not have anymore JSP code. The client NEVER runs JSP code.

  • Problems using - EPP RTK for Java

    Hello, I'm having problems using the EPP RTK for Java, I've got the message below:
    java.io.IOException: No ssl props location specified
         at com.tucows.oxrs.epp0402.rtk.transport.EPPTransportTCPTLS.connect(EPPTransportTCPTLS.java:116)
         at br.com.redenetworks.temp.Temp.<init>(Temp.java:21)
         at br.com.redenetworks.temp.Temp.main(Temp.java:35)
    Please, someone could help me?
    Thanks a lot,
    F�bio Kazahaya.

    Como vc deve saber eu virei Gerente de Copyright e Propriedade Intellectual do setor RBS da empresa.
    Eu encontrei esse artigo hoje e estou sendo for�ado a denunciar essas informa��es por quebra de copyright da prpriedade intellectual da empresa.
    Eu te conhe�o como um funcionario da IBM e estou muito desapontado
    Aguarde a IBM entrar em contato contigo.
    Abra�os

  • How to use bean objects in java script

    function insertRow()
              var row=1;
              var tbl = document.all("TAU");
         var tr = tbl.rows(row);
         var td = tr.cells(0);
         var td2 = tr.cells(1);
         var td3 = tr.cells(2);
         row++;
         tr = tbl.insertRow();
         tr.setAttribute(false);
         td = tr.insertCell();
         td2 = tr.insertCell();
         td3 = tr.insertCell();
         td.innerHTML = "<html:text property='unit' value ='02' />";
         td2.innerHTML = "<html:text property='unit Id' />" ;
         td3.innerHTML = "<html:text property='unit Type' />" ;
    this is my code, it is basicaly add row at run time thru java scripts. i want to set property of beans with this script , in this code i foun error ie. "can not found bean in nay scope" so plz anybody can tell me how can i pass bean object to java script !!!!!!

    mmmh i'm not understanding so much....
    well... as i told before i'm working in oracle database environment and i'm developing a java procedure.
    now, i have this object
    CREATE OR REPLACE
    TYPE REPORT.FATTURA_OBJ AS OBJECT (
    POD VARCHAR2(1000),
    ID_FATTURA NUMBER,
    ID_FILE NUMBER,
    COERENZA_EA_F VARCHAR2(1000),
    COERENZA_ER_F VARCHAR2(1000),
    COERENZA_EA_M VARCHAR2(1000),
    COERENZA_EF_M VARCHAR2(1000),
    ANOMALIA VARCHAR2(1000),
    MOTIVO_INVALIDAZIONE VARCHAR2(1000),
    MATRICOLA_CONTATORE VARCHAR2(1000),
    POTENZA_DISPONIBILE VARCHAR2(1000),
    MEMBER PROCEDURE pulisci
    /and i need to work with it inside this procedure:
    CREATE OR REPLACE AND RESOLVE JAVA SOURCE NAMED REPORT."Manage_Excel_ASMBS" AS
    import java.io.*;
    import java.io.IOException;
    import java.io.StringWriter;
    public class Manage_Excel_ASMBS
    public static void read_Excel(String inputFile,int var_Id_Caricamento, int var_Id_Distributore, String var_Distributore) throws SQLException, IOException
              **here i need to put what i'm reading inside the excel file into oracle objects**
    /can you please give me a sample ?
    thanks

  • Problem in the jsp, jstl and java script.

    Hi Friends,
    I am having one jsp which allows user(Could you please refer to code which is written in my jsp) to enter his username and password i want to get the password in the same jsp and want it to be passed to the custom tag without sending request to the server.Please give me an idea.Thanks in advance.
    This is the text field which allows a password.
    <INPUT type="password" name="password" size="10" maxlength="29" onblur="chkpwd()" onfocus="this.autocomplete=false" >
    and this is the anchor tag which refers as LOGIN BUTTON
    <IMG height=19 src="images/submit1.gif" width=106 border=0>
    when user clicks on LOGIN BUTTON i am calling one javascript function LOGIN(PASSWORD:) to check the validation if the validation is success then i want to get the password in the same function which is entered .
    This is ok i can get the password by "document.formName.password.value" then i need to pass this value to the jstl tag which is our own tag as shown below.
    <prefix:tagname value="PASSWORD which is having in the javascript variable".
    Please help me .
    Quick reply is thankfull.
    Edited by: bharathpolanki on Apr 20, 2008 1:55 AM
    Edited by: bharathpolanki on Apr 20, 2008 2:55 AM

    that's correct. You can use the below code for AJAX request.
    <script type="text/javascript">
    var httpObject = getHTTPObject();
    //create XMLHttpRequest object
    function getHTTPObject() {     
         var xmlhttp;
         if (window.XMLHttpRequest) // if Mozilla, Safari etc
              xmlhttp = new XMLHttpRequest();
         else if (window.ActiveXObject){ // if IE
              try {
                   xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
              catch ( e ){
                   try{
                        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
                   catch ( e ){}
         return xmlhttp;
    //define the function to send the request
    function sendRequest(){
        var currDesc = document.getElementById("description").value;
        var URL =  "manageMaintAction.do"; //action mapping in your struts-config
        var queryString = "currDesc="+escape(currDesc); //get the currDesc value in your action class like request.getParameter("currDesc")
        httpObject.open( "Post", URL, true );
        httpObject.onreadystatechange = cbFn;
        httpObject.setRequestHeader( "Content-Type", "application/x-www-form-urlencoded");
        httpObject.send(queryString);
    //callback fn
    function cbFn() {
        if (httpObject.readyState == 4)
             if (httpObject.status == 200)
              var result = httpObject.responseText;
              alert(result);
    </script>

  • Problems using deployJava.js with Java 7

    I found problems which vary by browser to the following script in an HTML page on Windows 7:
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    </head>
    <body>
    Launch me!!!
    <script src="http://www.java.com/js/deployJava.js"></script>
    <script>
    deployJava.setInstallerType("kernel");
    deployJava.createWebStartLaunchButton("yourAppHere.jnlp", '1.7.0');
    </script>
    </body>
    </html>
    The problem shows itself when Java 7 is not yet installed. Note: There is no need to have an actual "yourAppHere.jnlp", since the problems surface prior that being a requirement.
    Firefox 8.0:
    When the Launch button is clicked on Firefox, a brief dialog with a progress bar appear showing a small download. At completion, a Security Warning dialog appears:
    "This Java installer did not come from Sun...". The publisher is shown as Oracle America, Inc.
    The install proceeds as normal if the user overides the warning (though eventually missing a real jnlp will catch up with you). I do not know for sure but suspect the problem is with deployJava.js. One fixing this might also want to consider the implications MacOSX port when it is up and ready.
    IE 9.0.3:
    This browser is a total failure. The initial download dialog progresses to the end, then remains & the session is hung. The dialog is modal, so the only escape other than the power button is killing it via Task Manager.
    I am pretty sure these are bugs, but thought would see if others can reproduce Just save html to a file on desktop & double-click. Have these already been reported? Are there other tests that would be good? It has been years since I reported a Java bug, are there directions?
    Edited by: user3055980 on Nov 13, 2011 11:36 AM

    Before un-installing anything except the 1.7.0 JRE from a previous test, I did a search deployJava1.dll, I found 5. All show File Version 6.0.290.11 on the details tab of the properties dialog. That is not to say they are all the same file. I installed a 64 bit JDK, and apparently a 32 bit JRE. I do not remember exactly how I did that. Using the Process Explorer & clicking on the binoculars to find deployJava.dll, it shows that one being used is in C:\Windows\SysWOW64. I am really starting to hate having a JRE built into a JDK. Here is the list:
    1- 513KB 11/7/2011 C:\Program Files\Java\jre6\bin
    2- 513KB 11/7/2011 C:\Window\System32
    3- 513KB 11/7/2011 C:\Program Files\Java\jdk1.6.0_29\jre\bin
    4- 461KB 10/3/2011 C:\Program Files (x86)\Java\jre6\bin
    5- 461KB 10/3/2011 C:\Windows\SysWOW64
    FYI, checks for npDeployJava1.dll were consistent with above, though some were in a new_plugin sub dir. Also, FireFox is x86, not amd64.
    Removing the JDK6 Update 29 (64-bit) knocked out #3.
    Removing Java(TM) 6 Update 29 (64-bit) knocked out #1.
    Removing Java(TM) 6 Update 29 knocked out # 4.
    That leaves 2 & 5 still in place (Did not find any let over npDeployJava1.dll's). Nuked them manaully.
    Still found a references to deployJava1.dll in registry, which were ripped out @
    HKEY_CLASSES_ROOT\CLSID\{CAFEEFAC-DEC7-0000-0000-ABCDEFFEDCBA}\InprocServer32
    HKEY_CLASSES_ROOT\CLSID\{CAFEEFAC-DEC7-0000-0001-ABCDEFFEDCBA}\InprocServer32
    This registry pattern seemed to be repeated, just kept deleting.
    Have a clean system, and am now retrying the tests, BUT IT TRIES TO RUN jre-6u29-windows-i586-iftw-k.exe INSTEAD! I actually followed through for IE & 1.6 is what gets installed NOT 1.7. This is by far the worst. The other stuff might just be because of that stupid JRE instead the JDK. Double checked both the html & JNLP they are still asking for 1.7. Is this a bug or somehow intentional?

  • Problem using a jar file : java.lang.ClassNotFoundException: ApiConn

    Hi everyone.
    i am running a form that use a bean_area to call a jar.
    but i am getting this error, thanks in advnce for any tip.
    Java Plug-in 1.6.0_33
    Using JRE version 1.6.0_33-b05 Java HotSpot(TM) Client VM
    User home directory = C:\Users\user1
    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>
    java.lang.ClassNotFoundException: ApiConn
         at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Unknown Source)
         at oracle.forms.handler.UICommon.instantiate(Unknown Source)
         at oracle.forms.handler.UICommon.onCreate(Unknown Source)
         at oracle.forms.handler.JavaContainer.onCreate(Unknown Source)
         at oracle.forms.engine.Runform.onCreateHandler(Unknown Source)
         at oracle.forms.engine.Runform.processMessage(Unknown Source)
         at oracle.forms.engine.Runform.processSet(Unknown Source)
         at oracle.forms.engine.Runform.onMessageReal(Unknown Source)
         at oracle.forms.engine.Runform.onMessage(Unknown Source)
         at oracle.forms.engine.Runform.processEventEnd(Unknown Source)
         at oracle.ewt.lwAWT.LWComponent.redispatchEvent(Unknown Source)
         at oracle.ewt.lwAWT.LWComponent.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
         at java.awt.EventQueue.access$000(Unknown Source)
         at java.awt.EventQueue$1.run(Unknown Source)
         at java.awt.EventQueue$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
         at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
         at java.awt.EventQueue$2.run(Unknown Source)
         at java.awt.EventQueue$2.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)
    Dumping class loader cache...
    Live entry: key=http://192.168.10.100:7778/forms/java/,frmall.jar,siberia_jpg.jar,ApiConn.jar,Hasher.jar,ReadCommand.jar,WriteCommand.jar,libAPI.jar, refCount=1, threadGroup=sun.plugin2.applet.Applet2ThreadGroup[name=http://192.168.10.100:7778/forms/java/-threadGroup,maxpri=4]
    Done.
    in my form i have created a bean_area and used as implementation class :ApiConn
    in my formsweb.cfg i used this configuration: archive=frmall.jar,siberia_jpg.jar,ApiConn.jar,Hasher.jar,ReadCommand.jar,WriteCommand.jar,libAPI.jar
    in my forms/java i have placed my jar files listed in the frmall.jar
    i guess i am missing something but i dont know what it is.
    here is my ApiConn.java from wich i generate my jar file:
    package libAPI;
    * This contains connection. Everything should be here,
    * should operate with this class only
    import java.io.*;
    import java.net.*;
    import java.util.concurrent.LinkedBlockingQueue;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    * @author janisk
    public class ApiConn extends Thread {
    private Socket sock = null;
    private DataOutputStream out = null;
    private DataInputStream in = null;
    private String ipAddress;
    private int ipPort;
    private boolean connected = false;
    private String message = "Not connected";
    private ReadCommand readCommand = null;
    private WriteCommand writeCommand = null;
    private Thread listener = null;
    LinkedBlockingQueue queue = new LinkedBlockingQueue(40);
    * Constructor of the connection class
    * @param ipAddress - IP address of the router you want to conenct to
    * @param ipPort - port used for connection, ROS default is 8728
    public ApiConn(String ipAddress, int ipPort) {
    this.ipAddress = ipAddress;
    this.ipPort = ipPort;
    this.setName("settings");
    * State of connection
    * @return - if connection is established to router it returns true.
    public boolean isConnected() {
    return connected;
    public void disconnect() throws IOException{
    listener.interrupt();
    sock.close();
    private void listen() {
    if (this.isConnected()) {
    if (readCommand == null) {
    readCommand = new ReadCommand(in, queue);
    listener = new Thread(readCommand);
    listener.setDaemon(true);
    listener.setName("listener");
    listener.start();
    * to get IP address of the connection. Reads data from socket created.
    * @return InetAddress
    public InetAddress getIpAddress() {
    return sock == null ? null : sock.getInetAddress();
    * returns ip address that socket is asociated with.
    * @return InetAddress
    public InetAddress getLocalIpAddress() {
    return sock == null ? null : sock.getLocalAddress();
    * Socket remote port number
    * @return
    public int getPort() {
    return sock == null ? null : sock.getPort();
    * return local prot used by socket
    * @return
    public int getLocalPort() {
    return sock == null ? null : sock.getLocalPort();
    * Returns status message set up bu class.
    * @return
    public String getMessage() {
    return message;
    * sets and exectues command (sends it to RouterOS host connected)
    * @param s - command will be sent to RouterOS for example "/ip/address/print\n=follow="
    * @return
    public String sendCommand(String s) {
    return writeCommand.setCommand(s).runCommand();
    * exeecutes already set command.
    * @return returns status of the command sent
    public String runCommand() {
    return writeCommand.runCommand();
    * Tries to fech data that is repllied to commands sent. It will wait till it can return something.
    * @return returns data sent by RouterOS
    * @throws java.lang.InterruptedException
    public String getData() throws InterruptedException {
    String s = (String) queue.take();
    return s;
    * returns command that is set at this moment. And will be exectued if runCommand is exectued.
    * @return
    public String getCommand() {
    return writeCommand.getCommand();
    * set up method that will log you in
    * @param name - username of the user on the router
    * @param password - password for the user
    * @return
    public String login(String name, char[] password) {
    this.sendCommand("/login");
    String s = "a";
    try {
    s = this.getData();
    } catch (InterruptedException ex) {
    Logger.getLogger(ApiConn.class.getName()).log(Level.SEVERE, null, ex);
    return "failed read #1";
    if (!s.contains("!trap") && s.length() > 4) {
    String[] tmp = s.trim().split("\n");
    if (tmp.length > 1) {
    tmp = tmp[1].split("=ret=");
    s = "";
    String transition = tmp[tmp.length - 1];
    String chal = "";
    chal = Hasher.hexStrToStr("00") + new String(password) + Hasher.hexStrToStr(transition);
    chal = Hasher.hashMD5(chal);
    String m = "/login\n=name=" + name + "\n=response=00" + chal;
    s = this.sendCommand(m);
    try {
    s = this.getData();
    } catch (InterruptedException ex) {
    Logger.getLogger(ApiConn.class.getName()).log(Level.SEVERE, null, ex);
    return "failed read #2";
    if (s.contains("!done")) {
    if (!s.contains("!trap")) {
    return "Login successful";
    return "Login failed";
    @Override
    public void run() {
    try {
    InetAddress ia = InetAddress.getByName(ipAddress);
    if (ia.isReachable(1000)) {
    sock = new Socket(ipAddress, ipPort);
    in = new DataInputStream(sock.getInputStream());
    out = new DataOutputStream(sock.getOutputStream());
    connected = true;
    readCommand = new ReadCommand(in, queue);
    writeCommand = new WriteCommand(out);
    this.listen();
    message = "Connected";
    } else {
    message = "Not reachable";
    } catch (UnknownHostException ex) {
    connected = false;
    message = ex.getMessage();
    ex.printStackTrace();
    } catch (IOException ex) {
    connected = false;
    message = ex.getMessage();
    ex.printStackTrace();
    }

    I need your help again, i think this is a minor thing.
    i have compiled the class file that i needed and i signed it too. but now it is giving me a new error and need your tip.
    here is the java console loyout and my java file ((i think here is the problem in java file, something must be missing)).
    thanks in advance for any help.
    Java Plug-in 10.17.2.02
    Using JRE version 1.7.0_17-b02 Java HotSpot(TM) Client VM
    User home directory = C:\Users\Administrator
    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>
    network: Connecting http://192.168.10.100:7778/forms/lservlet;jsessionid=c0a80a6430d6e191eded93774f2f8d1bed73056e66ef.e3mObhiMbxeKe34PahiKbx4Nbh90n6jAmljGr5XDqQLvpAe with proxy=DIRECT
    security: Validate the certificate chain using CertPath API
    security: The certificate hasnt been expired, no need to check timestamping info
    security: Cannot find jurisdiction list file
    security: The CRL support is disabled
    security: The OCSP support is disabled
    security: This OCSP End Entity validation is disabled
    security: Checking if certificate is in Deployment denied certificate store
    security: Checking if certificate is in Deployment permanent certificate store
    basic: updateValidationResultsForApplet update
    cache: Mark prevalidated: http://192.168.10.100:7778/forms/java/ApiConn.jar true tm=1363335797289 cert=1371107987000
    basic: Plugin2ClassLoader.getPermissions CeilingPolicy allPerms
    java.lang.InstantiationException: oracle.forms.siberia.ApiConn
         at java.lang.Class.newInstance0(Unknown Source)
         at java.lang.Class.newInstance(Unknown Source)
         at oracle.forms.handler.UICommon.instantiate(Unknown Source)
         at oracle.forms.handler.UICommon.onCreate(Unknown Source)
         at oracle.forms.handler.JavaContainer.onCreate(Unknown Source)
         at oracle.forms.engine.Runform.onCreateHandler(Unknown Source)
         at oracle.forms.engine.Runform.processMessage(Unknown Source)
         at oracle.forms.engine.Runform.processSet(Unknown Source)
         at oracle.forms.engine.Runform.onMessageReal(Unknown Source)
         at oracle.forms.engine.Runform.onMessage(Unknown Source)
         at oracle.forms.engine.Runform.processEventEnd(Unknown Source)
         at oracle.ewt.lwAWT.LWComponent.redispatchEvent(Unknown Source)
         at oracle.ewt.lwAWT.LWComponent.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
         at java.awt.EventQueue.access$200(Unknown Source)
         at java.awt.EventQueue$3.run(Unknown Source)
         at java.awt.EventQueue$3.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
         at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
         at java.awt.EventQueue$4.run(Unknown Source)
         at java.awt.EventQueue$4.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)
    network: Connecting http://192.168.10.100:7778/forms/lservlet;jsessionid=c0a80a6430d6e191eded93774f2f8d1bed73056e66ef.e3mObhiMbxeKe34PahiKbx4Nbh90n6jAmljGr5XDqQLvpAe with proxy=DIRECT
    Exception in thread "Forms-DialogThread2" java.lang.NullPointerException
         at oracle.forms.handler.JavaContainer.onDestroy(Unknown Source)
         at oracle.forms.engine.Runform.destroyHandlers(Unknown Source)
         at oracle.forms.handler.DialogThread.doAlert(Unknown Source)
         at oracle.forms.handler.DialogThread.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Dumping class loader cache...
    Live entry: key=http://192.168.10.100:7778/forms/java/,frmall.jar,siberia_jpg.jar,ApiConn.jar,ConcealTextField.jar, refCount=1, threadGroup=sun.plugin2.applet.Applet2ThreadGroup[name=http://192.168.10.100:7778/forms/java/-threadGroup,maxpri=4]
    Done.
    here is my java file
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    package oracle.forms.siberia;
    * This contains connection. Everything should be here,
    * should operate with this class only
    import java.io.*;
    import java.net.*;
    import java.util.concurrent.LinkedBlockingQueue;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import oracle.forms.*;
    * @author janisk
    public class ApiConn extends Thread {
    private Socket sock = null;
    private DataOutputStream out = null;
    private DataInputStream in = null;
    private String ipAddress;
    private int ipPort;
    private boolean connected = false;
    private String message = "Not connected";
    private ReadCommand readCommand = null;
    private WriteCommand writeCommand = null;
    private Thread listener = null;
    LinkedBlockingQueue queue = new LinkedBlockingQueue(40);
    * Constructor of the connection class
    * @param ipAddress - IP address of the router you want to conenct to
    * @param ipPort - port used for connection, ROS default is 8728
    public ApiConn(String ipAddress, int ipPort) {
    this.ipAddress = ipAddress;
    this.ipPort = ipPort;
    this.setName("settings");
    * State of connection
    * @return - if connection is established to router it returns true.
    public boolean isConnected() {
    return connected;
    public void disconnect() throws IOException{
    listener.interrupt();
    sock.close();
    private void listen() {
    if (this.isConnected()) {
    if (readCommand == null) {
    readCommand = new ReadCommand(in, queue);
    listener = new Thread(readCommand);
    listener.setDaemon(true);
    listener.setName("listener");
    listener.start();
    * to get IP address of the connection. Reads data from socket created.
    * @return InetAddress
    public InetAddress getIpAddress() {
    return sock == null ? null : sock.getInetAddress();
    * returns ip address that socket is asociated with.
    * @return InetAddress
    public InetAddress getLocalIpAddress() {
    return sock == null ? null : sock.getLocalAddress();
    * Socket remote port number
    * @return
    public int getPort() {
    return sock == null ? null : sock.getPort();
    * return local prot used by socket
    * @return
    public int getLocalPort() {
    return sock == null ? null : sock.getLocalPort();
    * Returns status message set up bu class.
    * @return
    public String getMessage() {
    return message;
    * sets and exectues command (sends it to RouterOS host connected)
    * @param s - command will be sent to RouterOS for example "/ip/address/print\n=follow="
    * @return
    public String sendCommand(String s) {
    return writeCommand.setCommand(s).runCommand();
    * exeecutes already set command.
    * @return returns status of the command sent
    public String runCommand() {
    return writeCommand.runCommand();
    * Tries to fech data that is repllied to commands sent. It will wait till it can return something.
    * @return returns data sent by RouterOS
    * @throws java.lang.InterruptedException
    public String getData() throws InterruptedException {
    String s = (String) queue.take();
    return s;
    * returns command that is set at this moment. And will be exectued if runCommand is exectued.
    * @return
    public String getCommand() {
    return writeCommand.getCommand();
    * set up method that will log you in
    * @param name - username of the user on the router
    * @param password - password for the user
    * @return
    public String login(String name, char[] password) {
    this.sendCommand("/login");
    String s = "a";
    try {
    s = this.getData();
    } catch (InterruptedException ex) {
    Logger.getLogger(ApiConn.class.getName()).log(Level.SEVERE, null, ex);
    return "failed read #1";
    if (!s.contains("!trap") && s.length() > 4) {
    String[] tmp = s.trim().split("\n");
    if (tmp.length > 1) {
    tmp = tmp[1].split("=ret=");
    s = "";
    String transition = tmp[tmp.length - 1];
    String chal = "";
    chal = Hasher.hexStrToStr("00") + new String(password) + Hasher.hexStrToStr(transition);
    chal = Hasher.hashMD5(chal);
    String m = "/login\n=name=" + name + "\n=response=00" + chal;
    s = this.sendCommand(m);
    try {
    s = this.getData();
    } catch (InterruptedException ex) {
    Logger.getLogger(ApiConn.class.getName()).log(Level.SEVERE, null, ex);
    return "failed read #2";
    if (s.contains("!done")) {
    if (!s.contains("!trap")) {
    return "Login successful";
    return "Login failed";
    @Override
    public void run() {
    try {
    InetAddress ia = InetAddress.getByName(ipAddress);
    if (ia.isReachable(1000)) {
    sock = new Socket(ipAddress, ipPort);
    in = new DataInputStream(sock.getInputStream());
    out = new DataOutputStream(sock.getOutputStream());
    connected = true;
    readCommand = new ReadCommand(in, queue);
    writeCommand = new WriteCommand(out);
    this.listen();
    message = "Connected";
    } else {
    message = "Not reachable";
    } catch (UnknownHostException ex) {
    connected = false;
    message = ex.getMessage();
    ex.printStackTrace();
    } catch (IOException ex) {
    connected = false;
    message = ex.getMessage();
    ex.printStackTrace();
    }

Maybe you are looking for

  • Converting Word to pdf -  Text in "Pictures" corrupted

    When I convert a Word (ver 10 SP3) document with a graphic "picture" which contains both graphics and text to .pdf format with Acrobat 9 Pro the graphics convert fine but the text in the picture becomes very large and moves outside of the picture. Th

  • JTextField Focus is not comming

    Hi I have 2 JTextField(userName and password).I am entering wrong username and password .It goes to server and rsponse come with worning "Wrong input".Then I am entering the username again and after that when i Press the tab key .the curser come to t

  • Outbound idoc error - REFINT field

    I am trying to send orders.orders05 idoc from ecc to xi the message that I get in we02 in ECC is EDI: Field REFINT in control record with value 'T080902134731A ' is invalid Does somebody knows where this field is configured ? when I edited this idoc

  • Aperture + ATI 5770 upgrade

    Will I see a significant improvement in Aperture 3.1 by upgrading the graphics card in my 2008 MacPro to the ATI 5770 from the currently installed ATI 2600? More specifically, when working with RAW images using adjustment brushes and presets. Thanks.

  • Wanted to see the complete URL in Invoke activity dynamically

    Hi In BPEL instance that exists in em , Is there any possibility to see the complete URL for an Invoke activity which url it is hitting dynamically ? I have a cluster environment (001, 002) for an webservice , i am giving the load balancing URL, ever