You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Christian Joelly <ch...@knapp.com> on 2002/11/06 14:52:15 UTC

Using matchers, especially sessionstate...

Hello all!

i have some troubles using the sessionstate matcher in a pipeline.
I want to check for the existance of a session attribute, and when it
doesn't exist we should be redirected to a login page:

But i got lots of errors when i call want to use this pipeline...

  <map:pipeline>
  
    <map:match pattern="*" type="sessionstate">
      <map:parameter name="attribute-name" value="user"/>
      <map:redirect uri="login/login.xml"/>
    </map:match>
    
    <map:match pattern="**/*.css">
      <map:read src="css/{2}.css" mime-type="text/css"/>
    </map:match>
    
    <map:match pattern="images/**.*">
      <map:read src="images/{1}.{2}" mime-type="image/{2}"/>
    </map:match>
    
    <map:match pattern="**/*.js">
      <map:read src="jscript/{2}.js" mime-type="text/javascript"/>
    </map:match>
    
    <map:match pattern="applets/**">
      <map:read src="applets/{1}" mime-type="application/octet-stream"/>
    </map:match>
    
    <map:match pattern="*/**">
      <map:mount uri-prefix="{1}" src="{1}/" check-reload="yes"/>
    </map:match>
    
  </map:pipeline>

thx, Chris

-- 
KNAPP Logistics Automation  http://www.knapp.com
Ing. Christian Jölly        Tel/FAX: (++43) 316 / 495 1926 / 495 394
Günter-Knapp-Straße 5-7     A-8075 Hart bei Graz

-- Support your government, give Echelon/Carnivore something to parse --
AMTAS ATMD ATSC Abdullah Allah  communist CIA DD2-N DISA DoD GRU Gregori
Irak  Iran KGB  Kurdish LSD  NATO NSTD  Natasha  ORD RTEM  Russia  STRAP
Saddam Hussein  TSP  Yugoslavia   attack  bank  bomb  classfield  cocain
compromise defense  democracy  destroy  destruct  detonator  directorate
elections enforce extasy force  foreign embassy government grass hashish
heroin   illegal  information   international  military systems  missile
million dollars   nuclear  policital   pot  power   presidental  project
restricted data  revolution  rule the world sensitive  smuggle spy steal
system  takeover  terrorist  top-secret  warmod  warrior-T  weapon  weed
------------------------------------------------------------------------


Re: Using matchers, especially sessionstate...

Posted by Christian Joelly <ch...@knapp.com>.
Hello again!

i have tried to setup the pipeline another way and lokked at the
compiled sitemap java code. it seems that the java code generated is far
away from being complete...

are the sessionstate matcher code for the sitemap broken in cocoon
2.0.1? if so, can i change only the sessionstate code parts to avoid
migrating the whole application to a newer cocoon version?

thx, Chris

btw: sitemap and compiled sitemap attached for interest...

bbtw: compiled sitemap not fully attached because listadmin tells me
the posting is too big... ;-(

-snip

  //line numbers not supported with xalan// method for handling "*"
  private final boolean matchN101AC(SitemapRedirector redirector,
                                    Environment environment, StreamPipeline pipeline,
                                    EventPipeline eventPipeline, boolean internalRequest,
                                    List listOfMaps) throws ConnectionResetException,
  ResourceNotFoundException, Exception {
    Map map;
    Parameters param;
    Map objectModel = environment.getObjectModel();
    String cocoon_view = environment.getView();
    String cocoon_action = environment.getAction();
    final boolean debug_enabled = getLogger().isDebugEnabled();

    if ((map = matches("wildcard", matcher_N101AC_expr, "*",
                       Parameters.EMPTY_PARAMETERS, objectModel)) != null) {
      if (debug_enabled)
        getLogger().debug("Matched wildcard pattern *");
      listOfMaps.add (map);
      this.dumpParameters(listOfMaps);



      param = new Parameters ();
      param.setParameter ("attribute-name", "user");



      // handling "*"
<*>   if ((map = matches("sessionstate", matcher_N101AF_expr, "*",
                         param, objectModel)) != null) {
        if (debug_enabled)
          getLogger().debug("Matched sessionstate pattern *");
        listOfMaps.add (map);
        this.dumpParameters(listOfMaps);






        // handling "**/*.css"
        if ((map = matches("wildcard", matcher_N101B7_expr, "**/*.css",
                           Parameters.EMPTY_PARAMETERS, objectModel)) != null) {
          if (debug_enabled)
            getLogger().debug("Matched wildcard pattern **/*.css");
          listOfMaps.add (map);
          this.dumpParameters(listOfMaps);



          getLogger().debug("Component reader:resource(Parameters.EMPTY_PARAMETERS)");

          if (debug_enabled)
            getLogger().debug("Source= " +
                              substitute(listOfMaps, "css/{2}.css"));

          getLogger().debug("Mime-type= text/css");
          pipeline.setReader ("resource",
                              substitute(listOfMaps, "css/{2}.css"),
                              Parameters.EMPTY_PARAMETERS, "text/css");

          if (!internalRequest) {
            return pipeline.process(environment);
          }


          if (true)
            return true;


          listOfMaps.remove (listOfMaps.size() - 1);
          this.dumpParameters(listOfMaps);
        }





        // handling "images/**.*"
        if ((map =
               matches("wildcard", matcher_N101BF_expr, "images/**.*",
                       Parameters.EMPTY_PARAMETERS, objectModel)) != null) {
          if (debug_enabled)
            getLogger().debug("Matched wildcard pattern images/**.*");
          listOfMaps.add (map);
          this.dumpParameters(listOfMaps);



          getLogger().debug("Component reader:resource(Parameters.EMPTY_PARAMETERS)");

          if (debug_enabled)
            getLogger().debug("Source= " +
                              substitute(listOfMaps, "images/{1}.{2}"));

          getLogger().debug("Mime-type= image/{2}");
          pipeline.setReader ("resource",
                              substitute(listOfMaps, "images/{1}.{2}"),
                              Parameters.EMPTY_PARAMETERS, "image/{2}");

          if (!internalRequest) {
            return pipeline.process(environment);
          }


          if (true)
            return true;


          listOfMaps.remove (listOfMaps.size() - 1);
          this.dumpParameters(listOfMaps);
        }





        // handling "**/*.js"
        if ((map = matches("wildcard", matcher_N101C7_expr, "**/*.js",
                           Parameters.EMPTY_PARAMETERS, objectModel)) != null) {
          if (debug_enabled)
            getLogger().debug("Matched wildcard pattern **/*.js");
          listOfMaps.add (map);
          this.dumpParameters(listOfMaps);



          getLogger().debug("Component reader:resource(Parameters.EMPTY_PARAMETERS)");

          if (debug_enabled)
            getLogger().debug("Source= " +
                              substitute(listOfMaps, "jscript/{2}.js"));

          getLogger().debug("Mime-type= text/javascript");
          pipeline.setReader ("resource",
                              substitute(listOfMaps, "jscript/{2}.js"),
                              Parameters.EMPTY_PARAMETERS, "text/javascript");

          if (!internalRequest) {
            return pipeline.process(environment);
          }


          if (true)
            return true;


          listOfMaps.remove (listOfMaps.size() - 1);
          this.dumpParameters(listOfMaps);
        }





        // handling "applets/**"
        if ((map = matches("wildcard", matcher_N101CF_expr, "applets/**",
                           Parameters.EMPTY_PARAMETERS, objectModel)) != null) {
          if (debug_enabled)
            getLogger().debug("Matched wildcard pattern applets/**");
          listOfMaps.add (map);
          this.dumpParameters(listOfMaps);



          getLogger().debug("Component reader:resource(Parameters.EMPTY_PARAMETERS)");

          if (debug_enabled)
            getLogger().debug("Source= " +
                              substitute(listOfMaps, "applets/{1}"));

          getLogger().debug("Mime-type= application/octet-stream");
          pipeline.setReader ("resource",
                              substitute(listOfMaps, "applets/{1}"),
                              Parameters.EMPTY_PARAMETERS, "application/octet-stream");

          if (!internalRequest) {
            return pipeline.process(environment);
          }


          if (true)
            return true;


          listOfMaps.remove (listOfMaps.size() - 1);
          this.dumpParameters(listOfMaps);
        }





        // handling "*/**"
        if ((map = matches("wildcard", matcher_N101D7_expr, "*/**",
                           Parameters.EMPTY_PARAMETERS, objectModel)) != null) {
          if (debug_enabled)
            getLogger().debug("Matched wildcard pattern */**");
          listOfMaps.add (map);
          this.dumpParameters(listOfMaps);




          if (internalRequest)
            return sitemapManager.invoke (this.manager, environment,
                                          substitute(listOfMaps, "{1}"),
                                          substitute(listOfMaps, "{1}/"), true,
                                          true, pipeline, eventPipeline);
          else if (true)
            return sitemapManager.invoke (this.manager, environment,
                                          substitute(listOfMaps, "{1}"),
                                          substitute(listOfMaps, "{1}/"), true, true);


          listOfMaps.remove (listOfMaps.size() - 1);
          this.dumpParameters(listOfMaps);
        }



        listOfMaps.remove (listOfMaps.size() - 1);
        this.dumpParameters(listOfMaps);
      }

-snap

the generated code from sitemap_.java ends here. and on the line marked
with <*> i got a language exception at the character i from if and some
other language exceptions after this line till the last language
exception at the apprupt end of the java file...


On Wed, Nov 06, 2002 at 02:52:15PM +0100, Christian Joelly wrote:
> 
> i have some troubles using the sessionstate matcher in a pipeline.
> I want to check for the existance of a session attribute, and when it
> doesn't exist we should be redirected to a login page:
> 
> But i got lots of errors when i call want to use this pipeline...
> 
>   <map:pipeline>
>   
>     <map:match pattern="*" type="sessionstate">
>       <map:parameter name="attribute-name" value="user"/>
>       <map:redirect uri="login/login.xml"/>
>     </map:match>
>     
>     <map:match pattern="**/*.css">
>       <map:read src="css/{2}.css" mime-type="text/css"/>
>     </map:match>
>     
>     <map:match pattern="images/**.*">
>       <map:read src="images/{1}.{2}" mime-type="image/{2}"/>
>     </map:match>
>     
>     <map:match pattern="**/*.js">
>       <map:read src="jscript/{2}.js" mime-type="text/javascript"/>
>     </map:match>
>     
>     <map:match pattern="applets/**">
>       <map:read src="applets/{1}" mime-type="application/octet-stream"/>
>     </map:match>
>     
>     <map:match pattern="*/**">
>       <map:mount uri-prefix="{1}" src="{1}/" check-reload="yes"/>
>     </map:match>
>     
>   </map:pipeline>

-- 
KNAPP Logistics Automation  http://www.knapp.com
Ing. Christian Jölly        Tel/FAX: (++43) 316 / 495 1926 / 495 394
Günter-Knapp-Straße 5-7     A-8075 Hart bei Graz

-- Support your government, give Echelon/Carnivore something to parse --
AMTAS ATMD ATSC Abdullah Allah  communist CIA DD2-N DISA DoD GRU Gregori
Irak  Iran KGB  Kurdish LSD  NATO NSTD  Natasha  ORD RTEM  Russia  STRAP
Saddam Hussein  TSP  Yugoslavia   attack  bank  bomb  classfield  cocain
compromise defense  democracy  destroy  destruct  detonator  directorate
elections enforce extasy force  foreign embassy government grass hashish
heroin   illegal  information   international  military systems  missile
million dollars   nuclear  policital   pot  power   presidental  project
restricted data  revolution  rule the world sensitive  smuggle spy steal
system  takeover  terrorist  top-secret  warmod  warrior-T  weapon  weed
------------------------------------------------------------------------


Re: Using matchers, especially sessionstate...

Posted by Christian Joelly <ch...@knapp.com>.
Hello again!

i have tried to setup the pipeline another way and lokked at the
compiled sitemap java code. it seems that the java code generated is far
away from being complete...

are the sessionstate matcher code for the sitemap broken in cocoon
2.0.1? if so, can i change only the sessionstate code parts to avoid
migrating the whole application to a newer cocoon version?

thx, Chris

btw: sitemap and compiled sitemap attached for interest...

On Wed, Nov 06, 2002 at 02:52:15PM +0100, Christian Joelly wrote:
> 
> i have some troubles using the sessionstate matcher in a pipeline.
> I want to check for the existance of a session attribute, and when it
> doesn't exist we should be redirected to a login page:
> 
> But i got lots of errors when i call want to use this pipeline...
> 
>   <map:pipeline>
>   
>     <map:match pattern="*" type="sessionstate">
>       <map:parameter name="attribute-name" value="user"/>
>       <map:redirect uri="login/login.xml"/>
>     </map:match>
>     
>     <map:match pattern="**/*.css">
>       <map:read src="css/{2}.css" mime-type="text/css"/>
>     </map:match>
>     
>     <map:match pattern="images/**.*">
>       <map:read src="images/{1}.{2}" mime-type="image/{2}"/>
>     </map:match>
>     
>     <map:match pattern="**/*.js">
>       <map:read src="jscript/{2}.js" mime-type="text/javascript"/>
>     </map:match>
>     
>     <map:match pattern="applets/**">
>       <map:read src="applets/{1}" mime-type="application/octet-stream"/>
>     </map:match>
>     
>     <map:match pattern="*/**">
>       <map:mount uri-prefix="{1}" src="{1}/" check-reload="yes"/>
>     </map:match>
>     
>   </map:pipeline>

-- 
KNAPP Logistics Automation  http://www.knapp.com
Ing. Christian Jölly        Tel/FAX: (++43) 316 / 495 1926 / 495 394
Günter-Knapp-Straße 5-7     A-8075 Hart bei Graz

-- Support your government, give Echelon/Carnivore something to parse --
AMTAS ATMD ATSC Abdullah Allah  communist CIA DD2-N DISA DoD GRU Gregori
Irak  Iran KGB  Kurdish LSD  NATO NSTD  Natasha  ORD RTEM  Russia  STRAP
Saddam Hussein  TSP  Yugoslavia   attack  bank  bomb  classfield  cocain
compromise defense  democracy  destroy  destruct  detonator  directorate
elections enforce extasy force  foreign embassy government grass hashish
heroin   illegal  information   international  military systems  missile
million dollars   nuclear  policital   pot  power   presidental  project
restricted data  revolution  rule the world sensitive  smuggle spy steal
system  takeover  terrorist  top-secret  warmod  warrior-T  weapon  weed
------------------------------------------------------------------------


Re: Using matchers, especially sessionstate...

Posted by Christian Joelly <ch...@knapp.com>.
Hi Christian!

On Mon, Nov 11, 2002 at 11:17:15AM +0100, Christian Haul wrote:
> On 07.Nov.2002 -- 09:44 AM, Christian Joelly wrote:
> > i have attached the error message, the sitemap and the compiled sitemap.
> > i have also to tell that im not a very indepth cocoon developer so the
> > error messages are looking very strange to me :o)
> 
> Unfortunately, I can't make any out of it either. Sitemap looks OK, so
> does the generated .java file. The error messages are not really
> helpful :-(

i have switched to cocoon 2.0.3 now and i hope i dont have to change the
cocoon version for another time during this project =:-(

but: sitemap compiles well and there are some other messages in the
sitemap.log which i can't work around:

DEBUG   (2002-11-20) 15:23.06:565   [sitemap.matcher.sessionstate] (/knapp/reports/) Thread-38/WildcardSessionAttributeMatcher: Session attribute 'org.apache.cocoon.SessionState' not set

i have defined the session matcher in my pipeline as follows:

  <map:pipeline>

    <map:match type="sessionstate" pattern="*">
      <map:parameter name="attribut-name" value="user"/>
      
      <map:match pattern="**/*.css">
        <map:read src="css/{2}.css" mime-type="text/css"/>
      </map:match>
      
      <map:match pattern="images/**.*">
        <map:read src="images/{1}.{2}" mime-type="image/{2}"/>
      </map:match>
      
      <map:match pattern="**/*.js">
        <map:read src="jscript/{2}.js" mime-type="text/javascript"/>
      </map:match>
      
      <map:match pattern="applets/**">
        <map:read src="applets/{1}" mime-type="application/octet-stream"/>
      </map:match>
      
      <map:match pattern="*/**">
        <map:mount uri-prefix="{1}" src="{1}/" check-reload="yes"/>
      </map:match>
      
    </map:match>
  
  </map:pipeline>

whats going wrong now?? and why is the session attribute matcher looking
for the attribute "org.apache.cocoon.SessionState"?

thx, Chris

-- 
KNAPP Logistics Automation  http://www.knapp.com
Ing. Christian Jölly        Tel/FAX: (++43) 316 / 495 1926 / 495 394
Günter-Knapp-Straße 5-7     A-8075 Hart bei Graz

-- Support your government, give Echelon/Carnivore something to parse --
AMTAS ATMD ATSC Abdullah Allah  communist CIA DD2-N DISA DoD GRU Gregori
Irak  Iran KGB  Kurdish LSD  NATO NSTD  Natasha  ORD RTEM  Russia  STRAP
Saddam Hussein  TSP  Yugoslavia   attack  bank  bomb  classfield  cocain
compromise defense  democracy  destroy  destruct  detonator  directorate
elections enforce extasy force  foreign embassy government grass hashish
heroin   illegal  information   international  military systems  missile
million dollars   nuclear  policital   pot  power   presidental  project
restricted data  revolution  rule the world sensitive  smuggle spy steal
system  takeover  terrorist  top-secret  warmod  warrior-T  weapon  weed
------------------------------------------------------------------------


Re: Using matchers, especially sessionstate...

Posted by Christian Joelly <ch...@knapp.com>.
Hi Christian!

On Tue, Nov 12, 2002 at 12:09:16PM +0100, Christian Haul wrote:
> Please be aware that the above code may allow a user to substitute
> sNachname with a string like '"; close database; drop database somedb;' 
> what is probably not intended. Consider using prepared statements like
> 
> <esql:query>select distinct nUserID, sUserName from users where
> sNachname like <esql:parameter><xsp:expr>sNachname+"%"</xsp:expr></esql:parameter>

unfortunately there are lots of sql statements that depend on some
filters and other logic, so it's hard to implement dyn sql statements
with prepared statements...

another thing:

i have troubles with the GET parameters with cocoon 2.0.3:

the first value of a multivalued parameter occurs as the first AND the
last element of this parameter ("s_kst"):

METHOD: GET
CONTENT LENGTH: 0
PROTOCOL: HTTP/1.1
SCHEME: http
AUTH TYPE: null

CURRENT ACTIVE REQUESTS: 1
REQUEST PARAMETERS:

PARAM: 'Speichern' VALUES: '[Speichern]'
PARAM: 's_kst' VALUES: '[4100], [4232], [4233], [4234], [4235], [4236], [4100]'
PARAM: 'auftrag' VALUES: '[]'
PARAM: 'timestamp' VALUES: '[1037641279723]'
HEADER PARAMETERS:

PARAM: 'cookie' VALUES: '[JSESSIONID=qtpqzy4ho2]'
PARAM: 'connection' VALUES: '[keep-alive]'
PARAM: 'accept-encoding' VALUES: '[gzip, deflate, compress;q=0.9]'
PARAM: 'referer' VALUES: '[http://edvlw05.knapp.intern/knapp/reports/options.xsp?auftrag=&li=&lit=&litpos=]'
PARAM: 'accept' VALUES: '[text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0.2,text/css,*/*;q=0.1]'
PARAM: 'content-length' VALUES: '[0]'
PARAM: 'accept-charset' VALUES: '[ISO-8859-1, utf-8;q=0.66, *;q=0.66]'
PARAM: 'user-agent' VALUES: '[Mozilla/5.0 Galeon/1.2.6 (X11; Linux i686; U;) Gecko/20020913 Debian/1.2.6-2]'
PARAM: 'keep-alive' VALUES: '[300]'
PARAM: 'host' VALUES: '[edvlw05.knapp.intern]'

SESSION ATTRIBUTES:

PARAM: 'report' VALUE: ''
PARAM: 'etft' VALUE: ''


are there issues with this cocoon version and GET requests? with 2.0.1 i
can't use POST, because there that way was broken...

thx, Chris

-- 
KNAPP Logistics Automation  http://www.knapp.com
Ing. Christian Jölly        Tel/FAX: (++43) 316 / 495 1926 / 495 394
Günter-Knapp-Straße 5-7     A-8075 Hart bei Graz

-- Support your government, give Echelon/Carnivore something to parse --
AMTAS ATMD ATSC Abdullah Allah  communist CIA DD2-N DISA DoD GRU Gregori
Irak  Iran KGB  Kurdish LSD  NATO NSTD  Natasha  ORD RTEM  Russia  STRAP
Saddam Hussein  TSP  Yugoslavia   attack  bank  bomb  classfield  cocain
compromise defense  democracy  destroy  destruct  detonator  directorate
elections enforce extasy force  foreign embassy government grass hashish
heroin   illegal  information   international  military systems  missile
million dollars   nuclear  policital   pot  power   presidental  project
restricted data  revolution  rule the world sensitive  smuggle spy steal
system  takeover  terrorist  top-secret  warmod  warrior-T  weapon  weed
------------------------------------------------------------------------


Re: Using matchers, especially sessionstate...

Posted by Christian Haul <ha...@dvs1.informatik.tu-darmstadt.de>.
On 11.Nov.2002 -- 03:29 PM, Christian Joelly wrote:
> Hello!
> 
> On Mon, Nov 11, 2002 at 11:17:15AM +0100, Christian Haul wrote:
> > On 07.Nov.2002 -- 09:44 AM, Christian Joelly wrote:
> > > 
> > > thanks for your answer. I'd prefer to use the version 2.0.1 for this
> > > application, because maybe there are some other problems rising when i
> > > switch the cocoon version during development... ;-)
> > 
> > Fair enough. OTOH many issues have been resolved. There should be no
> > change in the user visible interface apart from stuff in scratchpad.
> 
> i'm now working to integrate cocoon 2.0.3 with my application, but i see
> there are some issues that are strange:
> 
> i wrote lots of sql queries in the following manner:
> (as i usual did with other frameworks or dev tools)
> 
> <xsp:logic>
> 	sQuery = "
> 		SELECT DISTINCT
> 			nUserID,
> 			sUserName
> 		FROM
> 			users";
> 
> 	if (sNachname != null) {
> 		sQuery =+ "
> 			WHERE
> 				sNachname LIKE \"" + sNachname + "%\";
> 	}
> 	
> 	<!-- lots of other tests go here... -->	
> 
> </xsp:logic>

Right, this appears to be a bug in Xalan, see
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=8734

If you don't use the same type of quotes inside the string it is OK
IIRC. The other option is to use search and replace all \" with '
s/\\"/'/g

Please be aware that the above code may allow a user to substitute
sNachname with a string like '"; close database; drop database somedb;' 
what is probably not intended. Consider using prepared statements like

<esql:query>select distinct nUserID, sUserName from users where
sNachname like <esql:parameter><xsp:expr>sNachname+"%"</xsp:expr></esql:parameter>

	Chris.
-- 
C h r i s t i a n       H a u l
haul@informatik.tu-darmstadt.de
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: Using matchers, especially sessionstate...

Posted by Christian Joelly <ch...@knapp.com>.
Hello!

On Mon, Nov 11, 2002 at 11:17:15AM +0100, Christian Haul wrote:
> On 07.Nov.2002 -- 09:44 AM, Christian Joelly wrote:
> > 
> > thanks for your answer. I'd prefer to use the version 2.0.1 for this
> > application, because maybe there are some other problems rising when i
> > switch the cocoon version during development... ;-)
> 
> Fair enough. OTOH many issues have been resolved. There should be no
> change in the user visible interface apart from stuff in scratchpad.

i'm now working to integrate cocoon 2.0.3 with my application, but i see
there are some issues that are strange:

i wrote lots of sql queries in the following manner:
(as i usual did with other frameworks or dev tools)

<xsp:logic>
	sQuery = "
		SELECT DISTINCT
			nUserID,
			sUserName
		FROM
			users";

	if (sNachname != null) {
		sQuery =+ "
			WHERE
				sNachname LIKE \"" + sNachname + "%\";
	}
	
	<!-- lots of other tests go here... -->	

</xsp:logic>

which works fine with 2.0.1, but on 2.0.3 cocoon generates:

org.apache.cocoon.ProcessingException: Language Exception: org.apache.cocoon.components.language.LanguageException: Error compiling options_xsp:
Line 1754, column 74:  unclosed character literal
Line 1754, column 73:  illegal start of expression
Line 1769, column 113:  unclosed character literal
Line 1772, column 10:  unclosed character literal
Line 1775, column 89:  illegal character
Line 1778, column 83:  unclosed character literal
Line 1778, column 82:  illegal start of expression
Line 1780, column 96:  illegal character
Line 1784, column 83:  unclosed character literal
Line 1784, column 82:  illegal start of expression
Line 1786, column 97:  illegal character
Line 1790, column 83:  unclosed character literal
Line 1790, column 82:  illegal start of expression
Line 1792, column 100:  illegal character
Line 1795, column 75:  unclosed character literal
Line 1795, column 74:  illegal start of expression
Line 1797, column 89:  unclosed character literal
Line 0, column 0: 
17 errors

	at org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.createResource(ProgramGeneratorImpl.java:340)
	at org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.load(ProgramGeneratorImpl.java:292)


the error comes from the " and the line break as i want to setup the sql
query string. can i set this behavior with an config option or is this
a java issue?!?

> > i have attached the error message, the sitemap and the compiled sitemap.
> > i have also to tell that im not a very indepth cocoon developer so the
> > error messages are looking very strange to me :o)
> 
> Unfortunately, I can't make any out of it either. Sitemap looks OK, so
> does the generated .java file. The error messages are not really
> helpful :-( 

hmmm, i don't think the generated javacode is ok, because it ends
suddenly without the nessessary java code...

thanks a lot,

Chris

-- 
KNAPP Logistics Automation  http://www.knapp.com
Ing. Christian Jölly        Tel/FAX: (++43) 316 / 495 1926 / 495 394
Günter-Knapp-Straße 5-7     A-8075 Hart bei Graz

-- Support your government, give Echelon/Carnivore something to parse --
AMTAS ATMD ATSC Abdullah Allah  communist CIA DD2-N DISA DoD GRU Gregori
Irak  Iran KGB  Kurdish LSD  NATO NSTD  Natasha  ORD RTEM  Russia  STRAP
Saddam Hussein  TSP  Yugoslavia   attack  bank  bomb  classfield  cocain
compromise defense  democracy  destroy  destruct  detonator  directorate
elections enforce extasy force  foreign embassy government grass hashish
heroin   illegal  information   international  military systems  missile
million dollars   nuclear  policital   pot  power   presidental  project
restricted data  revolution  rule the world sensitive  smuggle spy steal
system  takeover  terrorist  top-secret  warmod  warrior-T  weapon  weed
------------------------------------------------------------------------


Re: Using matchers, especially sessionstate...

Posted by Christian Haul <ha...@dvs1.informatik.tu-darmstadt.de>.
On 07.Nov.2002 -- 09:44 AM, Christian Joelly wrote:
> Hello!
> 
> thanks for your answer. I'd prefer to use the version 2.0.1 for this
> application, because maybe there are some other problems rising when i
> switch the cocoon version during development... ;-)

Fair enough. OTOH many issues have been resolved. There should be no
change in the user visible interface apart from stuff in scratchpad.

> i have attached the error message, the sitemap and the compiled sitemap.
> i have also to tell that im not a very indepth cocoon developer so the
> error messages are looking very strange to me :o)

Unfortunately, I can't make any out of it either. Sitemap looks OK, so
does the generated .java file. The error messages are not really
helpful :-( 

> btw: if i want to use newer matchers where are the directories in which
> i find the nessesary files to change? is the stuff in
> org/apache/cocoon/matching the right place to change the class files?

Right. But since the error appears when compiling the sitemap.xmap
file, the problem may well be somewhere else.

I'm afraid I can't help, sorry.

	Chris.
-- 
C h r i s t i a n       H a u l
haul@informatik.tu-darmstadt.de
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: Using matchers, especially sessionstate...

Posted by Christian Joelly <ch...@knapp.com>.
Hello!

thanks for your answer. I'd prefer to use the version 2.0.1 for this
application, because maybe there are some other problems rising when i
switch the cocoon version during development... ;-)

i have attached the error message, the sitemap and the compiled sitemap.
i have also to tell that im not a very indepth cocoon developer so the
error messages are looking very strange to me :o)

thx, Chris

btw: if i want to use newer matchers where are the directories in which
i find the nessesary files to change? is the stuff in
org/apache/cocoon/matching the right place to change the class files?

On Wed, Nov 06, 2002 at 07:45:51PM +0100, Christian Haul wrote:
> 
> On 06.Nov.2002 -- 02:52 PM, Christian Joelly wrote:
> > Hello all!
> > 
> > i have some troubles using the sessionstate matcher in a pipeline.
> > I want to check for the existance of a session attribute, and when it
> > doesn't exist we should be redirected to a login page:
> 
> Hi. Without the exact error message it is difficult to help. You say
> you're on 2.0.1 and can't go to 2.0.3. Try copying the java class from
> a newer version and rebuild. AFAIR it is rather self-contained. It
> might be necessary to copy all matchers if your version still uses
> matcher factories.
> 
> With the upcoming 2.0.4 version we have a better way to match for
> session attributes. You should really consider that.

-- 
KNAPP Logistics Automation  http://www.knapp.com
Ing. Christian Jölly        Tel/FAX: (++43) 316 / 495 1926 / 495 394
Günter-Knapp-Straße 5-7     A-8075 Hart bei Graz

-- Support your government, give Echelon/Carnivore something to parse --
AMTAS ATMD ATSC Abdullah Allah  communist CIA DD2-N DISA DoD GRU Gregori
Irak  Iran KGB  Kurdish LSD  NATO NSTD  Natasha  ORD RTEM  Russia  STRAP
Saddam Hussein  TSP  Yugoslavia   attack  bank  bomb  classfield  cocain
compromise defense  democracy  destroy  destruct  detonator  directorate
elections enforce extasy force  foreign embassy government grass hashish
heroin   illegal  information   international  military systems  missile
million dollars   nuclear  policital   pot  power   presidental  project
restricted data  revolution  rule the world sensitive  smuggle spy steal
system  takeover  terrorist  top-secret  warmod  warrior-T  weapon  weed
------------------------------------------------------------------------


Re: Using matchers, especially sessionstate...

Posted by Christian Haul <ha...@dvs1.informatik.tu-darmstadt.de>.
On 06.Nov.2002 -- 02:52 PM, Christian Joelly wrote:
> Hello all!
> 
> i have some troubles using the sessionstate matcher in a pipeline.
> I want to check for the existance of a session attribute, and when it
> doesn't exist we should be redirected to a login page:

Hi. Without the exact error message it is difficult to help. You say
you're on 2.0.1 and can't go to 2.0.3. Try copying the java class from
a newer version and rebuild. AFAIR it is rather self-contained. It
might be necessary to copy all matchers if your version still uses
matcher factories.

With the upcoming 2.0.4 version we have a better way to match for
session attributes. You should really consider that.

	Chris.
-- 
C h r i s t i a n       H a u l
haul@informatik.tu-darmstadt.de
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>