commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Short <...@benshort.co.uk>
Subject Re: [JCI] Complication Error
Date Tue, 20 Oct 2009 22:13:37 GMT
Hi,

Is the JspGenerator mean to be production ready? As I don't believe it
working correctly. Given the simple.jsp it generates the simple.java
which just writes everything to the http response.

simple.jsp

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="javax.jcr.Node" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">

<%
    Node currentNode = (Node)request.getAttribute("currentNode");
%>

<html>
  <head><title>Simple jsp page</title></head>
  <body>Place your content here</body>
</html>

simple.java

import java.io.PrintWriter;
import java.io.IOException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.ServletException;
public class simple extends HttpServlet {
  protected void service(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
    final PrintWriter out = response.getWriter();
    out.write("<%@ page contentType=\"text/html;charset=UTF-8\"
language=\"java\" %>");
    out.write("<%@ page import=\"javax.jcr.Node\" %>");
    out.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01
Transitional//EN\"");
    out.write("        \"http://www.w3.org/TR/html4/loose.dtd\">");
    out.write("");
    out.write("<%");
    out.write("    Node currentNode =
(Node)request.getAttribute(\"currentNode\");");
    out.write("%>");
    out.write("");
    out.write("<html>");
    out.write("  <head><title>Simple jsp page</title></head>");
    out.write("  <body>Place your content here</body>");
    out.write("</html>");
    out.close();
    out.flush();
  }
}

2009/10/19 Ben Short <ben@benshort.co.uk>:
> Ah I think I have cracked it...
>
> Changed
>
> ResourceReader resourceReader = new ResourceReader() {
>                        public byte[] getBytes(String s) {
>                                return jspSource;
>                        }
>
>                        public boolean isAvailable(String s) {
>                return true;
>                        }
>                };
>
>
> to
>
> ResourceReader resourceReader = new ResourceReader() {
>                        public byte[] getBytes(String s) {
>                                return jspSource;
>                        }
>
>                        public boolean isAvailable(String s) {
>                return "simple.jsp".equals(s);
>                        }
>                };
>
> Thanks.
>
> Ben
>
> 2009/10/19 Ben Short <ben@benshort.co.uk>:
>> lol sorry that's the object id isn't it.
>>
>> Then I have no more information to give you at present.
>>
>> 2009/10/19 Torsten Curdt <tcurdt@vafer.org>:
>>> http://commons.apache.org/jci/xref/org/apache/commons/jci/compilers/EclipseCompilationProblem.html
>>>
>>> I count only 79 lines :)
>>>
>>> On Mon, Oct 19, 2009 at 19:09, Ben Short <ben@benshort.co.uk> wrote:
>>>> Hi Torsten,
>>>>
>>>> The CompilationResult reports the problem on line 1747 of the following file
>>>>
>>>> org.apache.commons.jci.compilers.EclipseCompilationProblem
>>>>
>>>> Regards
>>>>
>>>> Ben Short
>>>>
>>>> 2009/10/19 Torsten Curdt <tcurdt@apache.org>:
>>>>> Do you fail to compile or fail to load the page created?
>>>>> Looks like a class loading problem.
>>>>>
>>>>> cheers
>>>>> --
>>>>> Torsten
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>>>>> For additional commands, e-mail: user-help@commons.apache.org
>>>>>
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>>>> For additional commands, e-mail: user-help@commons.apache.org
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>>> For additional commands, e-mail: user-help@commons.apache.org
>>>
>>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message