Originally posted by Muktesh Tripathi:
My development structure is BeerV1.src.com.example.web.BeerSelect.java
and
BeerV1.src.com.example.model.BeerExpert.java
package com.example.model;
import java.util.*;
public class BeerExpert {
public List getBrands(String color){
List brands = new ArrayList();
if(color.equals("amber")){
brands.add("Jack Amber");
brands.add("Reb Moose");
}
else{
brands.add("Jail Pale Ale");
brands.add("Gout Scout");
}
return (brands);
}
}
package com.example.web;
import com.example.model.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;
public class BeerSelect extends HttpServlet {
public void doPost(HttpServletRequest request,HttpServletResponse response)throws ServletException,IOException{
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("Beer Selecion Advice<br>");
String c = request.getParameter("color");
BeerExpert be = new BeerExpert();
List result = be.getBrands(c);
Iterator it = result.iterator();
while(it.hasNext()){
out.print("<br> Try: "+it.next());
}
}
}
to compile BeerExpert.java cd BeerV1
javac -d classes src/com/example/model/BeerExpert.java
it lands .class file to right folder correctly.
but on compiling BeerSelect cd BeerV1
javac -classpath c:\servlet-api.jar -d classes src/com/example/web/BeerSelect.java
it shows package does not exist error....
please help
Originally posted by Ulf Dittmer:
XPath makes it relatively easy to access the 2nd and 3rd occurrence directly, but it relies on the document structure not changing. SAX is more stable in the face of changing document structure.
Originally posted by Paul Clapham:
How would you like to "differentiate" them? For example, do you want to know that they contain different text? Or do you want to know which comes first, second, and third? Whatever, you will have to start out by defining your requirements before you try to implement them.
Originally posted by Peter Johnson:
Try adding the directory containing the properties files to the classpath.
Originally posted by Shawn Montague:
check out the "fileset" tag...you should be able to use that to include files during compilation.
Originally posted by Paul Clapham:
So, to sum it up and remove all the loosely-related background information: you have a String in Java and you want to remove the carriage-return characters from it? (No, there's no XML option for removing carriage-return characters via the parser.)
I will move this to the Java in General (Intermediate) forum. If you realize you already know the answer to my summed-up version of your question then you can go over there and post that.
Originally posted by Paul Clapham:
Only well-formed documents are XML. But a SAX parser will process a document until it reaches a place where it sees a problem.
In my opinion you would be better off getting the people who are sending you garbage documents to fix those documents themselves.
Originally posted by Paul Clapham:
You could do that with a SAX parser. Here is an example of how to use a SAX parser and a Locator to find the current parse location. Save the information and use it when the exception is thrown.
I assume this enormous malformed document is being generated by a computer program, and you're trying to fix that program?
Originally posted by Jean Jorge Michel:
Satish, thanks for your attention.
I am new Spring�s user (of course hahaha), and this configuration is the result of hours and hours fighting with Spring and search on Google a silver bullet to save me.
Today on morning (now in Rio de Janeiro/Brazil is 10: 50AM) I tried:
And the problem is the same.
Let me show �all problem�.
I Start MySQL DB and log in, is created 2 connections.
When I start my Tomcat and do login my pool is initialized and is created three new connections.
After login my JSF navigation rule redirect the browser to home, this page search on DB my notes and show it in a table. In this point is created more three connections. Now I have 8 connections with MySQL.
My transaction management is ignored or my pool is crazy =)
Here is my codes.
First login flow.
Second home flow:
Some idea?
Thanks for all help.