--

Anyone successful in getting oromatcher to work with Jserv.
Outside of servlet land all oro examples work fine (ie demos).

The below servlet worked fine until I added oro's Pattern methods.  It
now comes back with 
the requested URL /sevlets/Regex not found on this server.

Besides upgrading everything, any other suggestions??


example servlet 

import java.io.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
import com.oroinc.text.regex.*; 


public class Regex extends HttpServlet {

  PatternMatcher matcher = new Perl5Matcher();
  PatternCompiler compiler = new Perl5Compiler();
  Pattern pattern;
  PatternMatcherInput input;
  MatchResult result;
  
  String regularExpression= null;
  String sub=null;
  
  public void init (ServletConfig config)  throws ServletException {

  }

  public void doGet (HttpServletRequest req, HttpServletResponse res)
throws ServletException,IOException {
    ServletOutputStream out = res.getOutputStream();
    res.setContentType ("text/html");
   
    String Name = "test's";

    out.println("<html><body>");
    out.println("Name before is "+ Name);
        
    try {
      regularExpression = "'";
      sub = "''";
      pattern = compiler.compile(regularExpression);
    }  catch(MalformedPatternException e)  {
      out.println("Bad pattern.");
    }
    Name =
Util.substitute(matcher,pattern,sub,Name,Util.SUBSTITUTE_ALL);
    
    out.println("Name after is "+ Name);
    out.println("</form></body></html>");

    out.close();
    res.getOutputStream().close();
      }

  public void destroy ()  {  
    super.destroy(); 
  }



}


--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
READ THE FAQ!!!!     <http://java.apache.org/faq/>
Archives and Other:  <http://java.apache.org/main/mail.html/>
Problems?:           [EMAIL PROTECTED]

Reply via email to