~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

It seems as though placing a taglib declaration triggers some kind of taglib validation in action which blows up when it encounters a problem. Does this problem come with only the above mentioned JSP or does it happen with all the JSP's? If it happens only for the above mentioned JSP, you might have to run it through a sanitizer script which strips all the characters unacceptable by the XML specification. You can try this link for the same.

You can get the latest JSTL API + implementation here.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

IMO, the error is exactly what the trace says it is; it has found an illegal non-visual character in your markup.

Are you sure the error comes *only* when you put the taglib include and works otherwise? If yes, then instead of copy-pasting that line try typing it out. BTW, you are using an old version of JSTL; the uri should be http://java.sun.com/jsp/jstl/core .

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

This can be due to a lot of factors:
- Web application was not properly deployed i.e deploy time failure
- Attempt to access a path/resource which doesn't exist

Without more details like the name of your web application, the URL you are trying to access, your deployment descriptor etc. it would be kinda difficult to pin point the exact reason behind this.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> How would you recommend me doing this? Should I write the entire
> game from the ground up? Should I use a game engine?

Start small and definitely go for a game engine; you are trying to write a game and not a game engine. Leave the exercise of writing a game engine to a some other time. How about developing your game using Slick 2D Engineand then serving it via Java Web Start. Never done that but should be a fun exercise.

> Java applets?

AFAIK, Applets come with their own headaches and are generally frowned upon by end users due to their startup time. See my suggestion above for alternatives.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> but I'm still curious to know if there is a way, just in case I face this
> problem again

You can make your code work by passing in a list reference which already points to an existing List implementation. That way, even though you have a copy of the reference, it would in the end point to the same list which was passed. You'd need to change your Object de-serialization part of code to do an addAll() on the list passed by passing in the List read i.e.

if (prototype instanceof ArrayList) {
  list.addAll((ArrayList <Classe_Pessoa>)prototype);
}

You might want to add in a few null checks there though but yeah, that's how it can be done.

That being said, I'm still in favour of the method responsible for returning the data read in an appropriate container rather than the caller passing in a empty container to be filled by the method since your method puts undue responsibilities on the caller, something it isn't responsible for.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

This is because you effectively pass a copy of reference and not the list when invoking the method. Read this.

Crushyerbones commented: Very interesting +2
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> Sounds like a pure transformations' job. Are you supposed to use Java
> If not this is a job for XSLT.

XSTL works on XML; web pages which don't comply to the XHTML specification (almost all of them out there) don't have a valid XML markup. XSTL won't help if what you need to do is convert broken markup (html) to XML.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Happy New Year to all! :-D

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Using something like JTidy would be much easier IMO.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster
assertArrayEquals(int[] correctDuplicateSort, int[] sort.sort(duplicateInts));

assertArrayEquals expects two array references as its parameters; what you've got there is an array declaration. The correct way would be:

assertArrayEquals(correctDuplicateSort, sort.sort(duplicateInts));
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Read the example provided for ScheduledExecutorService.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Either use an IFRAME to embed an external site on your web page or use the "import" JSTL core tag (<c:import>).

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

IMO this looks like a case of cached values; even though the values were changed via backend [using some sort of query], the cache has not yet being cleared which might lead to such a thing.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

I wish all the members of Daniweb a Merry Christmas. Also a big thanks for helping us keep this forum alive and kicking. :-)

Oh, and as they say, Santa with gifts FTW! ;-)

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> Any advice on how I should create/define the document?

Here's a simple throw-away implementation in JDOM [requires jdom.jar of course]:

public static void main(String args[]) throws Exception {
   DocumentBuilder builder = DocumentBuilderFactory.newInstance()
         .newDocumentBuilder();
   DOMBuilder domBuilder = new DOMBuilder();
   Document jdomDoc = domBuilder.build(builder.parse(new File("src/home/projects/misc/Test.xml")));
   Iterator iter = jdomDoc.getRootElement().getChildren("JOB").iterator();
   while(iter.hasNext()) {
      Element jobElem = (Element)iter.next();
      if(jobElem.getChild("JOBNAME").getValue().equals("Second job")) {
         jobElem.getChild("INPUTFOLDER").setText("MY-NEW-LOCATION");
      }
   }
   XMLOutputter outputter = new XMLOutputter();
   outputter.output(jdomDoc, System.out);
}

In your case you can output or direct the XML to some other stream/file.

> But the quickest way to do your current task would probably be
> the regular methods such as Scanner and Regex

Given that I've dabbled with both XML processing API's and regular expressions, I disagree. I'd love to see a regular expression implementation of the above having the same sort of clarity and brevity. :-)

> rather than learn how to use JDOM.

I personally feel that one shouldn't shy away from using the best possible tool for the job even if it comes with a bit of learning curve. Experience has shown that implementing something in a round-a-bout way brings in too much pain and generally has a higher cost associated than learning the right tool and doing things right.

> There are some sort of web services xml bindings for java

You can very well use the XML processing libraries which implement the XML specifications without getting involved with web services i.e. XML processing != Web …

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Using a XML processing library like JDOM would significantly ease your job. All you'd need to do with such a library is:
- Parse the source XML document
- Get all the JOB nodes and filter the JOB node with the given JOBNAME
- Update the child elements of the JOB element
- Save the in-memory XML back to the file

But do keep in mind that this would become unwieldy if the file becomes too large due to the overhead of reading and writing an XML document. XML IMO is a bad format for frequent reading/writing of data. An embeddable small memory footprint database like H2/Derby would shine for your given use case.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

The problem I see here is:
- You don't have a business tier; any business you implement in your beans would have to be replicated when you are asked to use a different view technology. Also, placing the business logic in view components creates tight coupling which is undesirable as the code base grows
- Your DAO layer seems to be doing validations and throwing business exceptions. Realistically, there shouldn't be any *logic* inside a DAO, the DAO classes are only concerned with *data access* and not validation etc.

Refer to the J2EE design patterns for more details.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

What's the string outputted by your echo statement? Can you look at the page source and paste the exact output your see in view source? Also, this might help.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

IMO, if you are planning to work both in embedded and server modes, Derby would be a good choice for a beginner database. It supports almost all SQL features which you might need along with support for user defined procedures and functions. Also, it's a pure Java database with a type 4 JDBC driver which is easily available.

Of course, if it were some "enterprisy" project, I would have recommended PostgreSQL or Oracle[if you have the moolah]. :-)

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> How I go about getting documentantion?

Any JDBC tutorial out there should be good enough to get you started. The only difference would be the way the SQL driver is loaded. This would be a good start.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> I'm totally unclear on what's needed to get jsp code to run on a server

You'd need a WAR file for your web project which needs to be deployed on Tomcat to make it all work. Google around for "creating war file" and "deploying war file on Tomcat" for more details. After your WAR file is successfully deployed, test your application on http://yourhost:8080/your-war-name/your-jsp . Let us know if you are facing any issues with this.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

This definitely seems like a configuration issue of your hosting provider and normally happens when the requested resource is fetched directly by the web server instead of being redirected to Tomcat and allowing it to process your JSP request. The suggestions provided in this thread might help you out.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Seems to be a problem with the way your query is created; what's the JDBC type of `patientNo'? Is it a VARCHAR? If yes, then you need to wrap the passed in patient number in single quotes when constructing the query. If you don't, your database engine considers the passed in patient number as some kind of identifier or parameter and hence the given error.

BTW, your code is vulnerable to SQL Injection. Try passing in "xxx' or 1=1--" as patient number and watch all the rows being fetched instead of the one you requested. Use PreparedStatement instead of normal statements to save yourself from the trouble of escaping and quoting your input as well as SQL Injection.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> Should I use Connection Pooling?

Depends; all real life projects use pooling but if you have just started out, cutting down the complexity by not bothering about pooling wouldn't be that bad. There are some SQL mapping frameworks out there [iBatis] which handle all the pooling behind the scenes.

> any way to hold the result for that user utill he logout

Server side sessions; though putting in a lot of data might just slow down things. Caching at the DAO layer is yet another option. Again, frameworks like iBatis and Hibernate shine in this area with configurable caching options.

> Do I need to use MultiThread?

No, at least not when developing a web app since the servlet takes care of spawning a new thread for each request made.

> How should I divide it to get the MVC Model confirmed .

By using a framework which helps you enforce a clear separation of concerns. Spring MVC, Wicket, Struts 2, Tapestry are good contenders.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> JSTL main purpose is to only make your logic more readable

No, it's main purpose is separation of concerns and to make sure that you don't end up mixing your business and view logic. The ability to create reusable custom tags is a big win over having duplicate code in your code base which achieves the same functionality.

That being said, for any real project, I see no need for any technical architect to prefer JSTL over the plethora of Web MVC frameworks out there, each with their own tried and tested view technology. Spring MVC, Wicket, Struts 2, Tapestry; take your pick. :)

Edit: You might find this discussion interesting. Oh and BTW, for the sake of good old god, never ever use JSF!

rimorin commented: Thanks for the enlightening me +1
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Read more about BigDecimal and BigInteger in Java which are the de-facto classes used for performing arbitrary precision arithmetic.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>

It seems that you are using a pre JSTL 2.0 URI; in pre 2.0 JSTL, the set action is configured to not accept run-time expressions [rtexpr=false].

Try using <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> instead; it should work.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

You might want to take a look at an open source browser in java called Lobo. Though it has a limited rendering capabilities when compared to browsers like Firefox, AFAICT, it's the best you can get with Java.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> At least it proves that Dani does still listen to what members of the
> community say...

Yeah, that's really a nice thing; especially when almost all the regulars are out on the streets baring their pitchforks and torches, foaming at the mouth. ;)

Ancient Dragon commented: LOL :) +0
Nick Evan commented: Roaarr! ;) +0
sknake commented: lol :P +0
nav33n commented: :D heh +0
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> Why use abstract classes at all? Why not just declare a class and
> then make sure you never instantiate any variables of that type?

...because compile time checks are far superior/efficient when compared to your code blowing up at run time. Languages which don't have the concept of Abstract classes baked in reply on hacks to achieve the same [e.g. Actionscript 3].

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

You can either modify the properties of the command window [cmd] to show more than 500 lines [ALT + SPACE + P -> Screen Buffer Size -> Height] or pipe the output of your java program to some text file [java YourProgram > file.txt].

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> Well, 650,000 users cannot be involved in every single discussion.

I guess nor they would want to as many of them are here for a quick solution.

> Even 20 regulars who post in the feedback forum only represent the
> most vocal members

Correction, the most "faithful" and "caring" members; members who care when things change.

> Well then be more vocal about which features you use and how you use them.

Pretty twisted way of asking for a feedback, eh? :-)

> When you first visit DaniWeb, how do you begin your visit?

UserCP; the subscribed forum list along with the no-email thread subscription works wonders for me. I've never seen the main page, ever.

> The DaniWeb homepage is going to be entirely retooled to actually
> be useful, so hopefully it will make a good first destination when you
> visit the site.

How about keeping on making changes to the main page *without* touching the existing layout? :)

After all there seems to be a lot of space on the right as Mel said; this change seems as if you are forcing all the existing members to visit the home page before they start their daily routine surfing.

But then again, this thread has the same feel as the "quick reply v/s advanced reply" or "IT professional's lounge v/s Geeks Lounge" thread, so bleh. :-)

sknake commented: agreed +0
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> "Top Dog" is a common expression here in USA that means the boss or the leader

I'm very much aware of that expression but was expecting "brass" instead of "dog", hence that smiley. :-)

> I do not think daniweb mods are bad, in fact, quite the opposite

Good to hear that, thank you.

> tendency to over-react when a criticism is levelled at some facet of the site

I'd like to clarify this a bit; it's not just criticism against the site, but nonconstructive criticism/trolling in general which gets thrashed. Let's take an example of the very first post of this thread.

WTF? how do you get that?[...]
not that i care about this voting scheme; its obviously meaningless[...]
I just wonder how some Comp Sci folks figured out that 2/3 = 0.75

Now how about:

I currently have two up and one down votes but my total score quality comes out to be 75%? Is this a mistake or part of some weighted calculation? Can someone shed a bit more light on how this entire voting thing works? No bothered, merely curious. :-)

See the difference?

Mind you, not that a bit of sarcasm and drama is bad or anything, it's just that sarcasm begets sarcasm, trolling begets trolling. You get what you ask for, plain and simple. :-)

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Are both the class files present in the same "policy" directory? The physical directory structure which holds your .class files needs to reflect your package hierarchy. Read the sticky post at the top of the forum for more information regarding how to run Java programs.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

I'd assume that you are having problems viewing the output of your program, yes? In that case reading this might help. Also, take a look at the forum sticky for more resources to get started with Java.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

/me takes off the super-mod hat

> Here be tygers - and they don't like negativity

If someone treats the responses to all the threads in the Feedback forums as some kind of global conspiracy, then that person is seriously messed up in the head. :S

> You'll find the top dogs either saying it's not impt, so "shut up"
> and stop worrying

You forgot the obviously implied, "a newly introduced feature still under development". Oh and BTW, `dogs' is way too derogatory, I'm sure you had a better word in your dictionary, you just didn't use it. Subtle sneaky stabbers FTW. :)

/me puts on the super-mod hat ;)

diafol commented: very good +0
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> I think the main problem is when I ask a question it's a hard question

The main problem is not with the hard question but with the complexity of the question. A complex question is almost always a hard question but a hard question need not always be a complicated one.

IMO the main problem I think is with the way the questions are phrased. People tend to post their entire mind dump when asking questions which presents a difficulty to those trying to answer the questions. I've seen countless questions narrating the entire use case . Breaking the question in parts in such a way that the question can be easily understood even by those who are having a cursory glance at your thread helps a lot.

If not that, chances are that you *are* asking a very difficult question. In that case, you are anyways SOL. :-)

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Oh, sorry I didn't notice the replies here. :X

> Is your avatar from an anime? If yes from what?

Like ahihihi.. said, it's Midou Ban from Get Backers.

> My answer : Konohamaru

The correct answer is Naara Shikamaru. :-)

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Consider the possibility of Adatapost giving the green rep for the following content:

Points to be noted, raghuhr84

* Give the complete program, that is, give #include<stdio.h> . Becomes easier for us to check.
* Use proper indentation
* Use code tags around your program (See the forum rules)

No where does adatapost specify that the solution is a *good solution*. Overzealous, much? :P

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> overzealous, much?

Far better than a stalker with too much time on his hands IMO.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> part of the wide-ranging conspiracy is that the original thread was
> locked down [...] and FTR, the obsession is with Narue

We've already infracted two members on grounds of stalking and minor harassment. Play time's over, the sooner you realize it, the better. One more "OMG, Narue!?" post and this thread is gone....

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> Of course that doesn't discount the possibility that you are
> hermaphrodite

That sounds .. so .. disturbing on all counts... :S

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Also consider the possibility of Narue not finding the need to reply to threads which have been already replied by Tom with a more than satisfactory answer. :)

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Narue would never start a thread in the Community Introductions. ;-)

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> So what I need to know to be Java expert in Web and Desktop
> Applications?

Apart from the points already mentioned, I'd like to stress on reading good books/code. I've seen people churn out reams and reams of code without being aware that they are writing sub-standard code. Awareness is of prime importance. Practicing by repeating the same mistakes over & over again doesn't help IMO.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Try using the DocumentBuilderFactory instead of explicitly instantiating the parser.

public static void main(String args[]) throws Exception {
   DocumentBuilder builder = DocumentBuilderFactory.newInstance()
         .newDocumentBuilder();
   Document doc = builder.parse(new File("Test.xml"));
   System.out.println(doc.getElementsByTagName("name"));
}
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Oh yes, I'd be interested in one of those. :-)

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> For the context of an internet forum, three months is plenty of time to
> get meaningful responses

What about posts which don't get solved or don't receive event a single reply? There have been instances of some good replies streaming in after as late as an year.

Let's consider this scenario; a certain person is currently facing a problem & stumbles upon a Daniweb dicussion which doesn't have the entire solution, but enough to help him get to the solution he desires. In that case, it very much makes sense that the person might post the solution here which might in turn help out those who come to this forum facing the very same problem.

> every time that I've seen an old post revisited, it's just some
> variant on "ME TOO"

It's a kinda sad that the ratio of helpful/useful bumps to useless bumps is very low, giving people the impression that thread bumps are *always* useless.

Of course, this is all IMO and YMMV. ;-)

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster