3,892 Posted Topics
Re: GZIP or any other compression when used for web applications is almost/always at the web server/web container level rather than the framework/technology used. Do a web search for 'gzip apache' or 'gzip tomcat' for more details. | |
Re: It isn't a link when you are viewing your profile [i.e. when we click on our user name]. Navigate to the CP [control panel] wherein in the 'Latest Reputation Received' is shown as a link. | |
Re: Also, consider moving the `parse' method to a separate implementation class coded to an interface to allow for greater flexibility. Is that file format predefined or something which you have designed yourself? If the latter, then there are better ways of representing the same information. Just move all the point … | |
Re: When do you think the compile time error 'symbol not found comes up'? What does your text book say about such errors? The example you posted seems a pretty bold one for someone who has just started out with Java. Anyways, the error message means that the compiler doesn't know … | |
Re: You don't need to change the signature. You can obtain the `Class' instance of the primitives using either `int.class' or 'Integer.TYPE'. [code]import java.lang.reflect.Method; public class Reflection { public static void main(final String[] args) throws Exception { Method m = new Test().getClass().getMethod("doForInt", int.class); System.out.println(m.invoke(new Test(), 1)); } } class Test { … | |
Re: If the entire code base uses generics, there is no way that would happen; after all, generics were introduced for this very reason. Are you sure that the code base doesn't ditch generics and falls back to raw collections at some point? Have you used a debugger to trace the … | |
Re: > Can we have two servlets in one single project... Is it possible...? Yes. > Is it mandatory....? No. Normally, a single servlet is good enough to act as a controller for your entire application. Read the JEE 5 tutorial along with this [URL="http://groups.google.co.in/group/comp.lang.java.programmer/msg/c77f0274487a3fe1"]thread [/URL]on the google group. Any reason … | |
Re: > i want him taken out. If you stop posting here, you might never see him again... | |
Re: An observation regarding pop-ups -- don't you think it would be nice to show the pop-up to a non-registered user only *once* rather than showing it to him/her everytime he visits the Daniweb home page. A cookie based tracking might just do the job... | |
Re: > [url]http://redwing.hutman.net/~mreed/warriorshtm/acne.htm[/url] Gah, I was hoping for a quiz to do it for me; reading through all that stuff just to know who you are is so...mendokse. | |
Re: > I am having a null pointer error, don't know where it came out. Locating the cause of exceptions is something every Java programmer should be proficient in. Study the stack trace and use a debugger[or debugging statements] to locate the source of problem, *yourself*. | |
Re: Your question is a pretty generic one and can be roughly translated to "how would I go about developing web apps using JSP and Servlets?" in which case you should: - Start off with the [URL="http://java.sun.com/javaee/5/docs/tutorial/doc/"]JEE 5 tutorial/documentation[/URL] - Read the sticky at the top of this forum for a … | |
Re: The program seems a bit off. No need to implement Servlet; you are anyways extending HttpServlet. The DBInterface and RequestDispatcher members of your servlet class will be shared among all requests since each HTTP request spawns off a new thread which invokes the doXXX method [based on the request type]; … | |
Re: That wouldn't be unit testing... Let's suppose I have a class which implements two methods; finding the cube of a number and finding the square root of a number. As long as appropriate unit test cases are in place for each method, does it really matter how the combination of … | |
Re: Look into the [URL="http://www.google.co.in/search?hl=en&q=apache+commons+upload+example&btnG=Search&meta=&aq=f&oq="]Apache commons upload library[/URL]. | |
Re: IMO, the error is pretty obvious. What you need to do here is start small. Instead of getting an entire application to work, concentrate on miniscule exercises. Something like: - Having only one text field on your page and displaying the value on STDOUT after the user presses submit - … | |
Re: Read the sticky posted by Peter at the top of this forum for a sample web application. Also read the [URL="http://www.ibm.com/developerworks/views/java/libraryview.jsp?search_by=JSTL+primer"]JSTL primer series [/URL]at Developerworks which demonstrates building a blog using plain old JSP with JSTL used for presentation. Read the official [URL="http://java.sun.com/javaee/5/docs/tutorial/doc/"]JEE5 tutorials [/URL]for a brief overview of all … | |
Re: > Hello, I have a form inside a form. If possible, [URL="http://bytes.com/groups/html/95602-nested-forms"]reconsider[/URL] your design choice; nested forms violate the HTML specification. | |
Re: > If I don't write a topic that has something to do with C++ > programming I'll get banned, so give me a moment please. Not banned, the post will be deleted/moved. Anyways it still applies since your question still remains off-topic, I have moved it to the relevant forum. … | |
Re: A thorough way of doing it would be: [code] /** * Checks if a given string is float or not * * @author sos * @param {String} val The string in question. */ function isFloat(val) { if(!val || (typeof val != "string" || val.constructor != String)) { return(false); } var … | |
The 2009 Spring Preview is [URL="http://www.animevice.com/news/2009-spring-anime-preview-30-new-anime/814/"]here[/URL]! There are around 30 anime this time as opposed to around 23 in the previous season. As always, I'll try my best to watch everything, though Romance, Comedy and Action anime will be my first preference. :-) Anime FTW! | |
Re: > -- is supposed to be replaced with an escape sequence when it > appears in html code. No it isn't. | |
Re: Instead of sorting the array just to find the minimum, loop though the array continuously updating the 'min' variable. Something like: [code] int min = myArray[0]; for(int i = 1, limit = myArray.length; i < limit; ++i) { if(myArray[i] < min) min = myArray[i]; } System.out.println("The minimum is " + … | |
Re: So, what doesn't seem to be working? Start off with a minimalistic approach rather than trying to incorporate the functionality into your existing complicated code. Use an excellent Firefox addon Firebug to debug your Javascript. You can view the Javascript errors in Firebug as well as Firefox's Error console [Tools … | |
Re: Use the class attribute of a HTML element [accessed in Javascript using the className property] for convenient grouping; for each new checkbox spawned, assign it a common class name like 'spawnedCheckBox'. Then filter out or select all the checkboxes with the given class name using the [URL="http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsbyclassname/"]getElementsByClassName()[/URL] function. | |
Re: It's not OK, the return statement must go inside the catch block even when the function's contract is such that it *never* returns `null' for any input [as is the case with getElementsByTagName]. In languages which support Exceptions, there are usually two ways to break the execution flow of a … | |
Re: If you are talking about reading the contents of the form submitted using the GET or POST method, try looking into [INLINECODE]getParameter(input_type_name)[/INLINECODE] method of the request class. | |
Re: > How could i tackle this issue? By preserving the incomplete data submitted by the user and populating your HTML controls with it. Just store those user preferences in a bean class and store it in a session variable. On the dynamic page, just read those values. If they are … | |
Re: FYI, the people who cause inconvenience to others by smoking or the people who make laws aren't following this discussion. Clobbering each others feelings and views is no way to come to a conclusion. There is always a common ground and its the one on which we are standing right … | |
Re: I see in your code that you are not using [INLINECODE]srand( )[/INLINECODE] to seed or to initialize your random function and hence you are getting repetitive values. Try putting [INLINECODE]srand( time(NULL) )[/INLINECODE] at the start of your code and then see. For more description see [URL="http://www.cprogramming.com/fod/srand.html"]here.[/URL] HOpe it helped, bye. | |
Hello to alll programmers out there. Here i am trying to design a custom pascal triangle where the user can specify the TOP ELEMENT as well as both the CORNER elements. The problem i am facing is that the prog works well till the 3rd row but starts giving rubbish … | |
Re: > Oh come on. > You were not born Programmer Sure he wasn't but I don't think this would have been his reply when pointed in the right direction. Of course it's a different thing if you were just trying to get over this assignment... | |
Re: Its normal of Narue to disappear for sometime, reappear, post like crazy and again go in hiding. I wouldn't worry a lot if I were you. Whenever she starts posting, you would anyways come to know of her presence. :) > so she's a family girl then I wonder what … | |
Re: AFAIK, the [ICODE]oncontextmenu [/ICODE]is not supported across all browsers. But still if you want that kind of functionality, create a new HTML page which would be popped to the user when he clicks on the link. Inside that page instead of loading the XML document in a frame, load it … | |
Re: [document.getElementsByName()](http://www.w3schools.com/htmldom/met_doc_getelementsbyname.asp) returns a `nodeList` or simply put an array. You just can't directly assign a value to an array reference. You need to do something like the one given below assuming there is only element which goes by the name of 'FromZip'. `document.getElementsByName("FromZip")[0].value = 79797;` | |
Re: Or so you think. :-) > I was wondering if we could have new forums on DaniWeb, > especially for RIA's like Flex, JavaFx etc.. Forums or more specifically sub-forums are created only if a given technology generates enough traffic each day. Creating forums otherwise leads to "dead" forums which … | |
Re: Maybe something like [URL="http://www.javascripter.net/faq/sound/play.htm"]this?[/URL] | |
Re: Why not just create a normal window? The child window holds a reference to the parent window which created it in the form of 'opener' property. Here 'opener' is the window object of the parent window. [code] Parent.html <html> <head> <script> function go() { window.open("Child.html"); } </script> </head> <body> <form … | |
Re: It's not officially against the rule since any valuable addition to a thread discussion is more than welcome. Useless bumps to old threads are simply forked off as new threads. Just report any such occurrence and the moderator team would act accordingly. | |
Re: > But on the other hand, you have to start somewhere, right? Indeed; a dead forum sounds just right! :-) | |
Re: > How can I resolve this? Consider returning the zero-based position of the element in the array and -1 if the element doesn't exist.[code] //Sample invocation int[] arr = {1, 2, 3, 4}; int pos = Utils.search(arr, 1); // 0 pos = Utils.search(arr, 11); // -1[/code] Alternatively, take a look … | |
Re: [URL="http://en.wikipedia.org/wiki/NaN"]NaN[/URL]. Read the section on "How NaN is created", step through your code a single method at a time and it should be pretty easy. Use a debugger; a slick one which comes with Eclipse or a primitive command line debugger like "jdb" should do the job. | |
Re: AFAICT, the [I]<sql:param>[/I] tag needs to be nested inside the [I]<sql:query>[/I] tag. | |
Re: The browser in use can make a difference, the OS doesn't. Which browser are you using on Linux? If Firefox, try using the Firebug addon which provides Javascript debugging capabilities. For looking at Javascript errors if any, open up the Error Console [Tools -> Error Console]. | |
Re: > My insertion sort algorithm is failing to properly sort the points > based on angle roughly 30% of the time. That isn't an Insertion sort which you are trying to implement; also whichever algorithm that is, it's broken. Try it for input [5, 8, 1, 2]. Read [URL="http://en.wikipedia.org/wiki/Insertion_sort"]this[/URL]. | |
Re: You are trying to use `num' before initializing it i.e. providing it an initial value which works for member variables which have a default value but doesn't for local variables which don't. Move the two statements which ask the user for input and parse `num' before the statement which first … | |
Re: > " WHERE id=" + request.getParameter("'id';"); [icode]" WHERE id='" + request.getParameter("id") + "'";[/icode]. Your query has two problems: - [ICODE]request.getParameter("'id'")[/ICODE] tries to grab or look for the value of a form field with the name 'id' which isn't obviously what you are looking for. It should be [ICODE]request.getParameter("id");[/ICODE]. - If … | |
Re: Like it has already been mentioned, post your code which can be compiled and tested to reproduce the exact problem. | |
Re: > Security Error: It seems as though Firefox distinguishes between unsafe URI embedded in web pages and those written out explicitly in the location bar. IMO, this happens so because native executables when accessed using the FILE protocol directly execute and this might pose a *big* security vulnerability if the … |
The End.