You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by kace <me...@hotmail.com> on 2008/07/12 18:23:59 UTC

Re: [T5] CSS

Hi, how can I get the jetty server to pick up the css changes I make 

I've added this
<webDefaultXml>src/main/resources/webdefault.xml</webDefaultXml> to the
jetty plugin in the pom.  Right now I need to run mvn clean then restart
jetty:run for it to pick up the changes.  The css file is located in
/resources/org/example/myapp/assets/

Thanks

..kace 
-- 
View this message in context: http://www.nabble.com/-T5--tp18415269p18421243.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [T5] CSS

Posted by Andreas Andreou <an...@gmail.com>.
Yes, setting useFileMappedBuffer to false helps with jetty locking
files in windows

See the webdefault.xml from the TimeTracker app:
https://svn.apache.org/repos/asf/tapestry/tapestry4/trunk/tapestry-examples/TimeTracker/src/config/webdefault.xml


On Mon, Jul 14, 2008 at 10:48 AM, Joe Trewin <jo...@canfactory.com> wrote:
> Hi,
>
> We had this problem too - it's because Jetty by default using NIO, and
> there's a problem with that under windows. The solution we use is (in
> development) to configure Jetty to use just plain old io:
>
> So instead of using:
>
> <connector
> implementation="org.mortbay.jetty.nio.SelectChannelConnector">
>        <port>8081</port>
> </connector>
>
> Try:
>
> <connector implementation="org.mortbay.jetty.bio.SocketConnector">
>        <port>8081</port>
> </connector>
>
> However, in writing this reply I've just found the following:
>
> http://docs.codehaus.org/display/JETTY/Files+locked+on+Windows
>
> Which may be a more correct solution ...
>
>
>> -----Original Message-----
>> From: kace [mailto:me_myself_and_aye@hotmail.com]
>> Sent: 12 July 2008 22:00
>> To: users@tapestry.apache.org
>> Subject: Re: [T5] CSS
>>
>>
>> the jetty setup is nothing fancy :
>>
>> <!-- Run the application using "mvn jetty:run" -->
>>             <plugin>
>>                 <groupId>org.mortbay.jetty</groupId>
>>                 <artifactId>maven-jetty-plugin</artifactId>
>>                 <version>6.1.9</version>
>>                 <configuration>
>>                     <contextPath>/</contextPath>
>>
>> <webDefaultXml>src/main/resources/webdefault.xml</webDefaultXml>
>>                     <!-- Log to the console. -->
>>                     <requestLog
>> implementation="org.mortbay.jetty.NCSARequestLog">
>>                         <!-- This doesn't do anything for
>> Jetty, but is a workaround for a Maven bug
>>                              that prevents the requestLog
>> from being set.
>> -->
>>                         <append>true</append>
>>                     </requestLog>
>>                     <connectors>
>>                         <connector
>> implementation="org.mortbay.jetty.nio.SelectChannelConnector">
>>                             <port>8081</port>
>>                         </connector>
>>                     </connectors>
>>                 </configuration>
>>             </plugin>
>>
>> how do you have it setup?  I put the Layout.tml back under
>> /resources/org/example/myapp and now it works + now that the
>> css files are under webapp/ changes get picked up as I change
>> them - thanks.
>>
>> I haven't used annotation for css - use this <link rel="stylesheet"
>> type="text/css" href="${asset:context:/styles/main.css}"/>
>>
>> Regards,
>>
>> ..kace
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/-T5--tp18415269p18423614.html
>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
Andreas Andreou - andyhot@apache.org - http://blog.andyhot.gr
Tapestry / Tacos developer
Open Source / JEE Consulting

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


RE: [T5] CSS

Posted by Joe Trewin <jo...@canfactory.com>.
Hi,

We had this problem too - it's because Jetty by default using NIO, and
there's a problem with that under windows. The solution we use is (in
development) to configure Jetty to use just plain old io:

So instead of using:

<connector
implementation="org.mortbay.jetty.nio.SelectChannelConnector">
	<port>8081</port>
</connector>

Try:

<connector implementation="org.mortbay.jetty.bio.SocketConnector">
	<port>8081</port>
</connector>

However, in writing this reply I've just found the following:

http://docs.codehaus.org/display/JETTY/Files+locked+on+Windows

Which may be a more correct solution ...


> -----Original Message-----
> From: kace [mailto:me_myself_and_aye@hotmail.com] 
> Sent: 12 July 2008 22:00
> To: users@tapestry.apache.org
> Subject: Re: [T5] CSS
> 
> 
> the jetty setup is nothing fancy :
> 
> <!-- Run the application using "mvn jetty:run" -->
>             <plugin>
>                 <groupId>org.mortbay.jetty</groupId>
>                 <artifactId>maven-jetty-plugin</artifactId>
>                 <version>6.1.9</version>
>                 <configuration>
>                     <contextPath>/</contextPath>
>                    
> <webDefaultXml>src/main/resources/webdefault.xml</webDefaultXml>
>                     <!-- Log to the console. -->
>                     <requestLog
> implementation="org.mortbay.jetty.NCSARequestLog">
>                         <!-- This doesn't do anything for 
> Jetty, but is a workaround for a Maven bug
>                              that prevents the requestLog 
> from being set.
> -->
>                         <append>true</append>
>                     </requestLog>
>                     <connectors>
>                         <connector
> implementation="org.mortbay.jetty.nio.SelectChannelConnector">
>                             <port>8081</port>
>                         </connector>
>                     </connectors>
>                 </configuration>
>             </plugin>
> 
> how do you have it setup?  I put the Layout.tml back under 
> /resources/org/example/myapp and now it works + now that the 
> css files are under webapp/ changes get picked up as I change 
> them - thanks.
> 
> I haven't used annotation for css - use this <link rel="stylesheet"
> type="text/css" href="${asset:context:/styles/main.css}"/>
> 
> Regards,
> 
> ..kace
> 
> 
> --
> View this message in context: 
> http://www.nabble.com/-T5--tp18415269p18423614.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [T5] CSS

Posted by kace <me...@hotmail.com>.
the jetty setup is nothing fancy :

<!-- Run the application using "mvn jetty:run" -->
            <plugin>
                <groupId>org.mortbay.jetty</groupId>
                <artifactId>maven-jetty-plugin</artifactId>
                <version>6.1.9</version>
                <configuration>
                    <contextPath>/</contextPath>
                   
<webDefaultXml>src/main/resources/webdefault.xml</webDefaultXml>
                    <!-- Log to the console. -->
                    <requestLog
implementation="org.mortbay.jetty.NCSARequestLog">
                        <!-- This doesn't do anything for Jetty, but is a
workaround for a Maven bug
                             that prevents the requestLog from being set.
-->
                        <append>true</append>
                    </requestLog>
                    <connectors>
                        <connector
implementation="org.mortbay.jetty.nio.SelectChannelConnector">
                            <port>8081</port>
                        </connector>
                    </connectors>
                </configuration>
            </plugin>

how do you have it setup?  I put the Layout.tml back under
/resources/org/example/myapp and now it works + now that the css files are
under webapp/ changes get picked up as I change them - thanks.

I haven't used annotation for css - use this <link rel="stylesheet"
type="text/css" href="${asset:context:/styles/main.css}"/>

Regards,

..kace


-- 
View this message in context: http://www.nabble.com/-T5--tp18415269p18423614.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [T5] CSS

Posted by Fernando Padilla <fe...@alum.mit.edu>.
We keep all files under the /java/ directory.. *.java, *.tml, *.css, 
*.js etc, etc.  Just posing that as an option, because I'm not sure how 
you have your jetty setup.. the resources directory usually has to be 
copied over to the final location for things to work properly... but 
maybe it's running directly off of the main/webapp directory and/or the 
classpath is hot-loaded from target/classes ( hence anything under java 
directory can be hot-loaded )...

But I don't have a silver bullet for you, sorry.



How are you asking tapestry to bring in the css?  Through annotation?

@IncludeStylesheet( "context:/styles/main.css" )




kace wrote:
> no I haven't, I moved everthing out of /resources and now have the following
> layout:
> 
> /java/../components/
>             Layout.tml
>             Layout.java
> /java/../pages/
>            Index.java
> /webapp/styles/
>             main.css
> /webapp/
>            Index.tml
> 
> find the contents of Index.tml below...
> 
> running the app now only shows me [<t:pagelink
> t:page="Index">refreshsss</t:pagelink>] - the other text is missing and
> there is no css applied?  Any ideas...It worked when I had it under
> /resources/org/example/myapp/
> 
> 
> thanks
> 
> ..kace
> 
> <t:layout xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd" 
> t:title="literal:My first use of layout component" >
> 
> 
>         <p> This is the start page for this application, a good place to
> start your modifications.
>             Just to prove this is liv4e: </p>
> 
>         <p> The current time is: ${currentTime}. ${kace}</p>
> 
>         <p>
>             [<t:pagelink t:page="Index">refreshsss</t:pagelink>]
>         </p>
> 
> </t:layout>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [T5] CSS

Posted by kace <me...@hotmail.com>.
no I haven't, I moved everthing out of /resources and now have the following
layout:

/java/../components/
            Layout.tml
            Layout.java
/java/../pages/
           Index.java
/webapp/styles/
            main.css
/webapp/
           Index.tml

find the contents of Index.tml below...

running the app now only shows me [<t:pagelink
t:page="Index">refreshsss</t:pagelink>] - the other text is missing and
there is no css applied?  Any ideas...It worked when I had it under
/resources/org/example/myapp/


thanks

..kace

<t:layout xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd" 
t:title="literal:My first use of layout component" >


        <p> This is the start page for this application, a good place to
start your modifications.
            Just to prove this is liv4e: </p>

        <p> The current time is: ${currentTime}. ${kace}</p>

        <p>
            [<t:pagelink t:page="Index">refreshsss</t:pagelink>]
        </p>

</t:layout>
-- 
View this message in context: http://www.nabble.com/-T5--tp18415269p18423303.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [T5] CSS

Posted by Fernando Padilla <fe...@alum.mit.edu>.
did you try putting the css within the src/main/java/..... directory?

kace wrote:
> Hi, how can I get the jetty server to pick up the css changes I make 
> 
> I've added this
> <webDefaultXml>src/main/resources/webdefault.xml</webDefaultXml> to the
> jetty plugin in the pom.  Right now I need to run mvn clean then restart
> jetty:run for it to pick up the changes.  The css file is located in
> /resources/org/example/myapp/assets/
> 
> Thanks
> 
> ..kace 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org