tapestry-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Eynon <steve.ey...@alienfactory.co.uk>
Subject Re: pagecatalog and servicestatus
Date Wed, 02 Nov 2011 05:19:02 GMT
Cool!

But I'm also interested in your remote host ('cos I use an embedded
Jetty to!). Could you try adding this to one of your pages (not
checked for syntax):

@Inject
private Request request;

void setupRender() {
    System.err.println("RemoteHost="+request.getRemoteHost());
}

Cheers,

Steve.



On 2 November 2011 13:09, Chris Collins <chrisxyz@me.com> wrote:
> Well I take that request and up the ante.  Rather than doing what you asked (cause I
didn't know how todo it :-}).  I changed my request from http://localhost/..... to http://127.0.0.1/....
and it worked!!!!
>
>
> On Nov 1, 2011, at 10:01 PM, Steve Eynon wrote:
>
>> Having said that
>>
>> http://svn.apache.org/viewvc?view=revision&revision=1183162
>> and
>> http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/security/LocalhostOnly.java?view=markup&pathrev=1183162
>>
>> gives
>>
>> public class LocalhostOnly implements WhitelistAnalyzer {
>>    public boolean isRequestOnWhitelist(Request request) {
>>        String remoteHost = request.getRemoteHost();
>>        return remoteHost.equals("localhost") || remoteHost.equals("127.0.0.1");
>>    }
>> }
>>
>> Could you print out your "request.remoteHost" from one your pages and
>> check it's either "localhost" or "127.0.0.1"?
>>
>> Steve.
>>
>> On 2 November 2011 12:57, Steve Eynon <steve.eynon@alienfactory.co.uk> wrote:
>>> (Oh and I didn't mean to leave my last response hanging - only I'm not
>>> in a position to look at T5.3 code right now, so unfortunately I can't
>>> give much more than a few pointers...)
>>>
>>> Steve.
>>>
>>> On 2 November 2011 12:52, Chris Collins <chrisxyz@me.com> wrote:
>>>> Just to add to this (which I am sure points to the fact I am doing something
really stupid) I want to give a bit of a background and a validation (or an attempt at a validation).
>>>>
>>>> My process embeds jetty and adds the tapestry filter through web.xml (but
I am not using a standard tomcat or jetty "runner").
>>>>
>>>> I have a few of my own T5 pages that render fine though they are pretty basic
(components and pages).
>>>>
>>>> just to take my code out of the equation I took recent project Barry Books
posted for twitter-bootstrap earlier this week.  I added to his little project's web.xml:
>>>>
>>>>   <context-param>
>>>>        <param-name>tapestry.production-mode</param-name>
>>>>        <param-value>false</param-value>
>>>>    </context-param>
>>>>
>>>> Then I tried the demo and this particular path:
>>>>
>>>> http://localhost:8080/tapestry-bootstrap/servicestatus
>>>>
>>>> not much exciting happened.
>>>>
>>>> Thanks for your help and sorry this is probably described in large bold text
on some main page under "read this first" :-}
>>>>
>>>> Best
>>>>
>>>> C
>>>>
>>>> On Nov 1, 2011, at 9:24 PM, Chris Collins wrote:
>>>>
>>>>> PageCatalog: org.apache.tapestry5.corelib.pages.PageCatalog
>>>>> PropertyDisplayBlocks: org.apache.tapestry5.corelib.pages.PropertyDisplayBlocks
>>>>> PropertyEditBlocks: org.apache.tapestry5.corelib.pages.PropertyEditBlocks
>>>>> ServiceStatus: org.apache.tapestry5.corelib.pages.ServiceStatus
>>>>>
>>>>> package-info: org.apache.tapestry5.corelib.pages.package-info
>>>>>
>>>>>
>>>>> dont know if all these are supposed to be addressable in a meaningful
way.
>>>>> package-info blows a classformaterror
>>>>> propertyeditblocks gives me "<div></div>"
>>>>> propertydisplayblocks gives me a runtimeexception because a file coudlnt
be found during render time
>>>>> pagecatalog gives me a 404
>>>>> servicestatus gives me a 404
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On Nov 1, 2011, at 8:57 PM, Steve Eynon wrote:
>>>>>
>>>>>> When you start up T5 it lists all the available page class files
with
>>>>>> their corresponding URLs, e.g:
>>>>>>
>>>>>> ComponentClassResolver - Available pages:
>>>>>> ServiceStatus: org.apache.tapestry5.corelib.pages.ServiceStatus
>>>>>> PageCatalog: org.apache.tapestry5.corelib.pages.PageCatalog
>>>>>>
>>>>>> Do you see the pages listed?
>>>>>>
>>>>>> Steve.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> On 2 November 2011 11:21, Chris Collins <chrisxyz@me.com> wrote:
>>>>>>> I dont think that is the case.  I had already verified that
exception reporting was working.
>>>>>>>
>>>>>>> I programmatically set tapestry.production-mode=false in one
of my AppModule's (I didnt do it via the web.xml):
>>>>>>>
>>>>>>> ....
>>>>>>> configuration.add(SymbolConstants.PRODUCTION_MODE, "false");
>>>>>>> .....
>>>>>>>
>>>>>>>
>>>>>>> I have a page I test to see if this property is set:
>>>>>>>
>>>>>>>   @Inject
>>>>>>>   @Symbol(SymbolConstants.PRODUCTION_MODE)
>>>>>>>   @Property(write = false)
>>>>>>>   private boolean productionMode;
>>>>>>>
>>>>>>> .....
>>>>>>>
>>>>>>> <t:if test="productionMode">
>>>>>>>           <b>Production Mode</b>
>>>>>>>           <p:else>
>>>>>>>               <b>Not production mode still</b>
>>>>>>>           </p:else>
>>>>>>>       </t:if>
>>>>>>>
>>>>>>>
>>>>>>> it says it is in production mode or not (it says not production
mode).
>>>>>>>
>>>>>>> Further I have in a test page something that forces the exception
reporting:
>>>>>>>
>>>>>>> void onActionFromFail ()
>>>>>>>   {
>>>>>>>       throw new RuntimeException("Failure inside action event
handler.");
>>>>>>>   }
>>>>>>>
>>>>>>> It blows a lovely exception report page (I love it!!!!).
>>>>>>>
>>>>>>> C
>>>>>>>
>>>>>>> On Nov 1, 2011, at 4:26 PM, Howard Lewis Ship wrote:
>>>>>>>
>>>>>>>> The pages are "invisible" when not in development mode, so
the most
>>>>>>>> likely case is that you are not actually running in development
mode.
>>>>>>>>
>>>>>>>> On Tue, Nov 1, 2011 at 12:29 PM, Chris Collins
>>>>>>>> <chris_j_collins@yahoo.com> wrote:
>>>>>>>>> I am a novice at T5 so apologize for what is surely a
stupid question.
>>>>>>>>>
>>>>>>>>> I am trying out 5.3-rc-1.
>>>>>>>>>
>>>>>>>>> I am trying to get either the pagecatalog or servicestatus
pages such:
>>>>>>>>>
>>>>>>>>> http://localhost:<myport>/<page>
>>>>>>>>
>>>>>>>> By default, the pages are only accessible from localhost.
 This should
>>>>>>>> work ... but possibly something else is going on. What is
your dev
>>>>>>>> environment (OS, etc.)?
>>>>>>>>
>>>>>>>>>
>>>>>>>>> I can render any of my pages but neither of these pages
seem to be found.  I am running in developer mode.  Any clues on my stupidity?
>>>>>>>>
>>>>>>>> I'd phrase it as "Any idea what I'm missing."  There's a
lot going on
>>>>>>>> in Tapestry (almost, too much) , and in all the tiers of
client web
>>>>>>>> browser and HTTP between you and it, so don't jump to the
conclusion
>>>>>>>> that it's you ... or that it's Tapestry.
>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Best
>>>>>>>>>
>>>>>>>>> C
>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> Howard M. Lewis Ship
>>>>>>>>
>>>>>>>> Creator of Apache Tapestry
>>>>>>>>
>>>>>>>> The source for Tapestry training, mentoring and support.
Contact me to
>>>>>>>> learn how I can get you up and productive in Tapestry fast!
>>>>>>>>
>>>>>>>> (971) 678-5210
>>>>>>>> http://howardlewisship.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
>>>>>>>
>>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> 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
>>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> 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
>>
>
>
> ---------------------------------------------------------------------
> 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


Mime
View raw message