- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 21
- Posts with Upvotes
- 20
- Upvoting Members
- 16
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
129 Posted Topics
Re: setting the font to the text field should work. Also to center align the text use textfield.setHorizontalAlignment(JTextField.CENTER); Following code might help you, [CODE] import java.awt.Color; import java.awt.Font; import java.awt.*; import java.awt.font.*; import java.io.*; import javax.swing.*; public class TextFieldExample{ public static void main(String[] args) { JFrame frame = new JFrame(); frame.setLayout(null); … | |
Re: There is no way to get the values of the unchecked checkboxes because when a HTML form is submitted the values of checked checkboxes are sent to the server. One workaround would be use hidden input fields for storing all the values [CODE] <input type="hidden" name="chkboxvalues" value="<%=rs2.getString("description") %>"/> [/CODE] and … | |
Re: To use jquery first download the jquery-1.4.1.js file from the link at [url]http://docs.jquery.com/Downloading_jQuery#Current_Release[/url] Copy it in your webapp folder and use it in the <head> section of the web page as [CODE] <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript" SRC="jquery-1.4.1.js"></script> [/CODE] Now if you an select element with id "seltest" as, [CODE] <SELECT ID="seltest" … | |
Re: Instead of directly writing the DocumentContainer.innerHTML into the document of the new window, append the style sheet info to the text. Suppose there is 'testStyle' in 'test.css' that is applied to the <div> tag then try this [CODE] var strHtml = "<html>\n<head>\n <link rel=\"stylesheet\" type=\"text/css\" href=\"test.css\">\n</head><body><div style=\"testStyle\">\n" + DocumentContainer.innerHTML + … | |
Re: You can use SWT to open the browser and render the HTML from memory like given in the example at [url]http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet136.java?view=co[/url] You can find more helpful browser related SWT snippets at [url]http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet136.java?view=co[/url] | |
Re: There are many overloaded runReportToPdf() methods for the JasperRunManager object including the one without connection. Go through the JasperRunManager APIs for more details | |
Re: The line [CODE] <input type="hidden" name="varname" value="calledFunction();" />[/CODE] does not assign the value returned from the javascript function to 'varname' but assign the value 'calledFunction();'. Hence you are getting the function name in your jsp. You will have to assign the value to 'varname' at the onclick event of the … | |
Re: In the opened popup window you can read the values of the parent window like, [CODE] window.opener.formname.elemname.value; [/CODE] and then display this value on the pop up page | |
Re: One way can be that you can check if the div that is added dynamically exists or not by getElementById() funtion and than add or remove it. Hope the sample code below helps you, [CODE] <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE> New Document </TITLE> <SCRIPT LANGUAGE="JavaScript"> … | |
Re: The problem is with the line [CODE] dv.attachEvent("onmouseclick",function(){element_event_onmouseclick();}); [/CODE] because both IE and FF attach events differently via javascript. For solution to this, first check the browser type. A simple though not very powerful way can be [CODE] //detecting the browser version var bname = navigator.appName; var isIE = false; … | |
Re: There are couple of issues with the array manipulations that you are doing. 1] In Museum.java you are reading the input file with the loop, [CODE] for(int w = 0; w < WEEK-1; w++) { for(int d = 0; d < DAY-1; d++) { for(int h = 0; h < … | |
Re: I think the error is because of missing taglib entries in WEB-INF/web.xml file. First verfiy that you have also copied the jakarta-taglibs-standard-1.0.6\tld folder into the WEB-INF Now in web.xml file add the following entries, [code=XML]<taglib> <taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri> <taglib-location>/WEB-INF/tld/c.tld</taglib-location> </taglib>[/code] | |
Re: At line 43 you are using the for statement as [CODE] for(int j=0;j<serverdata2.length;j++) [/CODE] but the variable 'serverdata2' is set to null at line 22. This is causing the NullPointerException | |
Re: In the code inputs[i].onkeyup = function() { ................. } you assign a function for that handles keyup event. It does the multiplication there. You can add your logic to calculate the grand total there. | |
Re: If the image is stored as blob binary data you cannot display it is using simply the c:out tag. You need to create a servlet which streams the image from the server and call it in img tag as something like <img src="/getImage?petid=${row.petid}" /> Now in the servlet 1. Read … | |
Re: You will require a scheduler like 'quartz' for this purpose. You can find it at [url]http://www.quartz-scheduler.org[/url] along with the related documentation of its usage in a servlet container etc. | |
Re: Opera does not fire the onunload() event when a page is refreshed. I dont think there could be any solution to this as of now | |
Re: Alternatively you can also use this javascript to get all the input elements having name matching a particular regular expression and process on it [CODE] <script language="JavaScript"> <!-- //set the array filter function if it is not present if (!Array.prototype.filter) { Array.prototype.filter = function(fun /*, thisp*/) { var len = … | |
Re: Implicit objects are only visible within the system generated _jspService() method. They are not visible within methods you define yourself in declarations. So you are getting errors with out.write and/Or out.println. We have to pass them to our own method if we wish to use them locally in those functions. … | |
Re: Since you are entering value with a preceding 0, the parseInt(<value>) function takes it as an octal number. Use the parseInt(<value>, <radix>) function instead with radix set to 10 for decimal numbers as shown below, [CODE] var perOfEasyQues = parseInt(document.getElementById("<%=txb_EasyQuesPerc.ClientID%>").value, 10); [/CODE] | |
Re: Try setting the attributes for table as border="0" cellpadding="0" cellspacing="0" This will remove all the borders from the table Then make appropriate changes to above CSS and apply them to rows and columns of the table to give the desired effect | |
Re: There are two select boxes with the name="menu" in the above code snippet. Hence the javascript code at line 3 above, [CODE] if (document.frm.menu.value == "other") { [/CODE] is not working as expected. You can either change the name of the second select box or change the javascript code to … | |
Re: you can use javascript onclick event to set the text to blank. e.g [CODE] .... <input type="text" name="description" value="Description" onclick="this.value='';"> .... [/CODE] | |
Re: Write a javascript function which will accept the above xml as a parameter and than parse the xml using jquery. [CODE] function parseItemXML(itemXML){ $(itemXML).find('item').each(function(){//For each item element in the xml var showDateTxt = $(this).find('showDate').text(); //get the date var showDate = $.datepicker.parseDate( "mm/dd/yy", showDateTxt); //parse the date using the datapicker jquery … | |
Re: ini4j is a good library to work on ini files. You can use following code sample to add a value in the existing ini file, [CODE] //New Ini instance Ini ini = new Ini(); //Load the ini file File file = new File("test.ini"); ini.load(new FileReader(file)); //adds a new value ini.add("Section", … | |
Re: Seems like you have copy-pasted the code in line 5 in date.jsp. [CODE] <jsp:useBean id=“my” scope="request" class=“hi”> [/CODE] If you look properly you will see that the double quotes for attributes 'id' and 'class' are not normal double quotes. Try using normal double quotes as shown in the code given … | |
Re: If you look at the code properly you will notice that at the following block of code,[CODE] else if(reqact=="add"){//add sent atitle="Add"; newlink="Action(" + locid + ",'cancel')"; } [/CODE] The value of atitle is set to 'Add' instead of 'Cancel'. Hence you fell that it is not working :-) | |
Re: It seems that the entries are deleted because the form is submitted to the server even after you click cancel on the confirm box. One of the reason for this could be that the delete button could be of the type submit e.g. <input type="submit" name="Delete"> make the type of … | |
Re: One thing you must always remember while dealing JSP or any server side scripting is that the server side code is executed first at the server than the resulted HTML is sent to the browser. So in the code snippet given above all the java code between <%= %>, and … | |
Re: First in the code posted above there are syntax errors at line 29. Since you are assiging a string to a variable and that string has single quotes you have to escape them correctly as follows, [CODE] newdiv.innerHTML = '<br>Please copy and paste additional information here<input type='textarea' id='mytext''+i+'')>'; [/CODE] Now … | |
Re: The exception "java.lang.NoClassDefFoundError: org/apache/naming/resources/Resource" indicates that tomcat cannot find the above class anywhere in the classpath. In tomcat5.5 this class is in the file 'naming-resources.jar'. See if this file is present at the location <tomcat5.5>\common\lib I think due to some reason tomcat might not have installed properly. Try installing it … | |
Re: What you are doing in the servlet is that you are setting the 'tagValue' as an attribute in the request and than forwarding the request. But for AJAX requests all you have to do is just send the 'tagValue' on the response output stream You should do something like this … | |
Re: First you missed the double quotes for page attribute. The line should be [CODE] <jsp:include page="<%=thePage%>" flush="true"></jsp:include> [/CODE] Also you can only use relative urls for the page attribute. As per the docs, The relative URL looks like a pathname--it cannot contain a protocol name, port number, or domain name. … | |
Re: Try [CODE] newDisplay = ""; [/CODE] instead of [CODE] newDisplay = "block"; [/CODE] What it will do is that it will try to remove any style applied and try to set it to the elements inherent values and as a result should work in both FF and IE. Hope this … | |
Re: Yes it is possible to make the radio button disabled using javascript but the problem will be that the radio button's value wont be submitted to server if it is disabled. You will have to use some hidden fields to pass the value to the server | |
Re: The code is fine. It seems that the EL is not evaluating in the webserver. The reasons for these may be, 1] Your web.xml should does not have reference to web-app_2_4.xsd schema or higher e.g. [CODE] <web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4"> [/CODE] 2] You might have disabled the EL … | |
Re: Looking at the code snippet posted by you, I dont think you need to append 'a' as you are already passing parameters like 'a19', 'a20'.....etc in the Toggle() function. Only thing is that pass them as a string as shown in eg below [CODE] ... <input type="radio" name="abc" onClick="Toggle('a18');" value="a18"> … | |
Re: It seems to be the problem with the line [CODE] Connection conn = DriverManager.getConnection("jdbc:postgresql://localhost:8080/Employee", "rtz_jhay","kudeta7"); [/CODE] You are trying to connect the d/b on port 8080. This port is generally used by web-servers. Try to find the port on which you can connect to postgresql. The default is 5432 Hope … | |
Re: Using <jsp:include> will help you to include the jsp with combo-box within another jsp dynamically at runtime. | |
Re: As per what my understanding of the problem goes, setting the attribute 'target' wont help because the form is not submitting any form. You are just changing location in the navigate() javascript function. You can achieve what you want by changing the line [CODE] document.location.href=go; [/CODE] in the navigate() javascript … | |
Re: You can use an extra parameter in your showUser() javascript function and pass the type of operation as the second parameter, e.g. Change the function as, [CODE] .... function showUser(str, op){ .... [/CODE] Modify all call to showUser as [CODE] <input type="button" name="edit" value="Assign" id="edit" style="background-color:#A7C942; color:#ffffff; font-size: 1.2em;" onclick="showUser(this.value, … | |
Re: One way that I can think of is that instead of passing this.value in the onchange event of the select box you can pass the object this itself as follows, [CODE] <select name="**the name is dynamically got from database**" onChange="div_It(this);"> [/CODE] And than in the div_It() function you can use … | |
Re: System.out.println (newTi + newCh + newGi); Will not give you the desired result. Java do not have any inline function that will evaluate a expression. You will have to write the method to evaluate. You can do like check the value of 'newCh' and perform the operation on the two … | |
Re: You can check the classpath set by executing the command echo %CLASSPATH% on the command window. It displays the classpath set on your system. If the classpath variable is not properly set Also try setting the classpath variable in, Control Panel -> System ->Adavanced tab -> Environment Variable -> System … | |
Re: To prevent a form from submitting, the validating function must be called from the onsubmit event of the <form> tag and this function should than return true or false. e.g You will need to use something like the code given below [CODE] <form method="post" action="send.php" onsubmit="return sendform()"> [/CODE] Now if … | |
Re: From the code snippet posted, I think that the issue is with missing ending ')' at the line 35 [CODE] var parameters = 'comment='+escape(encodeURI(document.getElementById('comment_box').value)) +'&phototiding='+escape(encodeURI(document.getElementById('phototiding').value)) +'&picname='+escape((encodeURI(document.getElementById('picname').value)); [/CODE] This is causing Javascript errors and that might be the cause of the issue The line should be [CODE] var parameters = 'comment='+escape(encodeURI(document.getElementById('comment_box').value)) … | |
Re: A very nice tutorial on JavaWorld at the link given below will solve all your queries regarding use of JNDI in a standalone application [url]http://www.javaworld.com/javaworld/jw-04-2002/jw-0419-jndi.html?page=1[/url] Hope this was helpful. | |
Re: Your table schema is SID NUMBER(9) SNAME VARCHAR2(8) SADD VARCHAR2(16) but in the delete query is delete from student_info where stu_id=? Given the above schema, I think it should be as follows, delete from student_info where sid=? | |
Re: Formatter lets you pass an Appendable object. This is a interface that defines append methods so that the formatter can store its results in a text collector such as a stream object. Formatter formatter = new Formatter(); creates a formatter and the destination of the formatted output is a StringBuilder … | |
Re: The error is that "BufferedReader cannot be resolved to a type". It is caused because you have not imported the corresponding libraries. Import the libraries in JSP as <@page import="java.io.BufferedReader"> ... and so on Also the file can be placed anywhere on the server if you are using absolute filepaths. … |
The End.