Jsession Test Question

2015-12-10 Thread Lois GreeneHernandez
Hi All,

Is it possible to write a unit test or a pojo that tests an request url for the 
presence of a jsessionid?  My application Is java/wicket.  Our test system is 
testNG and wicket tester.

Thanks

Lois


relative or absolute redirects (use in proxy?)

2015-12-10 Thread Rob Audenaerde
Hi all,

I'm trying to host a Wicket Application in an Azure cloud environment. A
third party with Azure knowledge (which I lack atm) put up a proxy for us
that enforces 2factor authentication. If the user is allowed in, the
traffic is send to our application.

That way we don't have to spend too much time internet-hardening* our
application, while still being able to run it in the cloud.

However, it seems Wicket (/Jetty?) is redirecting to browser to absolute
urls, and these are not reachable from the browser.

For example, our app runs at somemagicurl222343.cloud.net, and is available
at proxy url: client-proxy.cloud.net.  Redirects are given to
somemagicurl222343.cloud.net, which is not directly reachable.

What would be the 'proper' solution?

I think the proxy might rewrite redirects (not sure how), but maybe
relative redirects would solve the issue as well?



*we stick to OWASP etc. as much as possible, but it is sensitive data so we
try to be on the safer side by keeping the application behind a fence.


Re: Jsession Test Question

2015-12-10 Thread Richard W. Adams
The short answer is no. The session ID is not part of the URL.

The long answer is, you can test for the session ID if you have access to 
the HTTP request object.




From:   Lois GreeneHernandez 
To: "users@wicket.apache.org" 
Date:   12/10/2015 01:50 PM
Subject:Jsession Test Question



This email originated from outside of the company.  Please use discretion 
if opening attachments or clicking on links.

Hi All,

Is it possible to write a unit test or a pojo that tests an request url 
for the presence of a jsessionid?  My application Is java/wicket.  Our 
test system is testNG and wicket tester.

Thanks

Lois



**

This email and any attachments may contain information that is confidential 
and/or privileged for the sole use of the intended recipient.  Any use, review, 
disclosure, copying, distribution or reliance by others, and any forwarding of 
this email or its contents, without the express permission of the sender is 
strictly prohibited by law.  If you are not the intended recipient, please 
contact the sender immediately, delete the e-mail and destroy all copies.
**


RE: Jsession Test Question

2015-12-10 Thread Ephraim Rosenfeld
I would have to do further research, but some ideas:
*   This example shows how to simulate putting a URL in browser, which is 
helpful for mounted pages: 
https://ci.apache.org/projects/wicket/guide/6.x/guide/testing.html#testing_1
*   The 
WicketTester
 class has some useful methods, like getHttpSession, getLastRequest, 
getLastResponse. These may allow you to find some information regarding the URL

I would try the latter first, just printing out what the request and response 
data have.

- Ephraim

-Original Message-
From: Lois GreeneHernandez [mailto:lgreenehernan...@knoa.com]
Sent: Thursday, December 10, 2015 2:51 PM
To: users@wicket.apache.org
Subject: Jsession Test Question

Hi All,

Is it possible to write a unit test or a pojo that tests an request url for the 
presence of a jsessionid?  My application Is java/wicket.  Our test system is 
testNG and wicket tester.

Thanks

Lois



Re: ExternalImage

2015-12-10 Thread Sebastien
Hi,

ExternalImage will be available in 7.2.0. It is currently available in
7.2.0-SNAPSHOT.

Best regards,
Sebastien

On Thu, Dec 10, 2015 at 10:17 AM, xesj.hu  wrote:

> Hi !
>
> I use wicket 7.1 with this code, but I get compile error!
>
> org.apache.wicket.markup.html.image.ExternalImage x;
>
> ExternalImage is exists in the documentation.
>
> Bye, xesj.hu
>


ExternalImage

2015-12-10 Thread xesj.hu
Hi !

I use wicket 7.1 with this code, but I get compile error! 

org.apache.wicket.markup.html.image.ExternalImage x;

ExternalImage is exists in the documentation.

Bye, xesj.hu 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/ExternalImage-tp4672923.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: How to set the page title?

2015-12-10 Thread Martin Grigorov
Hi,

Better use #renderHead(IHeaderResponse).

#renderHead(HtmlHeaderContainer) is for internal jobs. This is improved in
7.x to avoid such confusions.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Thu, Dec 10, 2015 at 7:44 AM, Martin Makundi <
martin.maku...@koodaripalvelut.com> wrote:

> Another way in overriding class:
>
> /**
>* @see
>
> org.apache.wicket.Component#renderHead(org.apache.wicket.markup.html.internal.HtmlHeaderContainer)
>*/
>   @Override
>   public void renderHead(HtmlHeaderContainer container) {
> super.renderHead(container);
> getResponse().write("" +
> application.getEmployee().getPerson().displayName() + "");
>   }
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/How-to-set-the-page-title-tp4662372p4672919.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: Jsession Test Question

2015-12-10 Thread Martin Grigorov
Hi,

WicketTester *simulates* a browser and a web server.
In a normal setup the web server (like Tomcat) generates and encodes the
jsessionid in the url.
WicketTester creates a Wicket Session for the test(s) and there is no need
of transferring jsessionid in the url/cookie.
You can use tester.executeUrl(";jsessionid=123456") and assert for it
in your server code by using getWebRequest().getUrl().toString() but this
is very artificial.

In your application code you can use
http://docs.oracle.com/javaee/6/api/javax/servlet/http/HttpServletRequest.html#getRequestedSessionId()
and
http://docs.oracle.com/javaee/6/api/javax/servlet/http/HttpServletRequest.html#isRequestedSessionIdFromURL()
Maybe WicketTester should add support for those.
Currently the code in MockHttpServletRequest looks like:


/**
 * Check whether session id is from a cookie. Always returns true.
 *
 * @return Always true
 */
@Override
public boolean isRequestedSessionIdFromCookie()
{
   return true;
}

/**
 * Check whether session id is from a url rewrite. Always returns false.
 *
 * @return Always false
 */
@Override
public boolean isRequestedSessionIdFromUrl()
{
   return false;
}



Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Thu, Dec 10, 2015 at 8:50 PM, Lois GreeneHernandez <
lgreenehernan...@knoa.com> wrote:

> Hi All,
>
> Is it possible to write a unit test or a pojo that tests an request url
> for the presence of a jsessionid?  My application Is java/wicket.  Our test
> system is testNG and wicket tester.
>
> Thanks
>
> Lois
>


Re: relative or absolute redirects (use in proxy?)

2015-12-10 Thread Martin Grigorov
Hi,

In short: you need a reverse proxy.

Longer story:

It is a bit blurry for me now because I did it one year ago but here is
what I did for one of my applications that is deployed at Azure:
1) created 3 images (Ubuntu), named "ubuntu1", "ubuntu2", ...
2) each of them runs Tomcat (for the Wicket app) on ports 8081, 8082, 8083
respectively. Tomcat listen on somemagicurl.cloud.net
2.1) these ports are opened only in my Azure account (don't remember the
exact term for my private network at Azure)
3) each image also runs Nginx at port 80, as a proxy.
3.1) each Nginx knows about the three Tomcat (for failover)
3.2) Azure load balancer balances the Nginx instances, so they serve
www.myrealapp.com
3.3) Nginx config uses reverse proxy to fix the urls coming from Tomcats


Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Thu, Dec 10, 2015 at 8:48 PM, Rob Audenaerde 
wrote:

> Hi all,
>
> I'm trying to host a Wicket Application in an Azure cloud environment. A
> third party with Azure knowledge (which I lack atm) put up a proxy for us
> that enforces 2factor authentication. If the user is allowed in, the
> traffic is send to our application.
>
> That way we don't have to spend too much time internet-hardening* our
> application, while still being able to run it in the cloud.
>
> However, it seems Wicket (/Jetty?) is redirecting to browser to absolute
> urls, and these are not reachable from the browser.
>
> For example, our app runs at somemagicurl222343.cloud.net, and is
> available
> at proxy url: client-proxy.cloud.net.  Redirects are given to
> somemagicurl222343.cloud.net, which is not directly reachable.
>
> What would be the 'proper' solution?
>
> I think the proxy might rewrite redirects (not sure how), but maybe
> relative redirects would solve the issue as well?
>
>
>
> *we stick to OWASP etc. as much as possible, but it is sensitive data so we
> try to be on the safer side by keeping the application behind a fence.
>


Re: Wizard localization

2015-12-10 Thread Martin Grigorov
Hi Maxim,

The order of the loaders is defined at:
https://github.com/apache/wicket/blob/master/wicket-core/src/main/java/org/apache/wicket/settings/ResourceSettings.java#L220-L224
You can redefine it by using #getStringResourceLoaders().clear();
#getStringResourceLoaders().addAll(betterOrderedList);

This is a nasty hack! I agree!

I think Wizard[_lang].properties should be moved
to org/apache/wicket/extensions/Initializer[_lang].properties

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Thu, Dec 10, 2015 at 6:00 PM, Maxim Solodovnik 
wrote:

> Thanks Sebastien :)
>
> Hello All,
>
> I would like to redefine wizard button on "Application level", maybe
> someone can suggest how it can be possible to redefine string resource
> resolution order?
>
> Here is the original question:
> I have question regarding jqueryui wizard button localization, I need to
> localize "Finish" button
> I have added string on "Application" level (Application.properties.xml
> file)
> bla-bla
> and seems to have no effect
>
> this http://www.7thweb.net/wicket-jquery-ui/wizard/DefaultWizardPage page
> states I need to create  *MyPage*.properties or *MyWizard*.properties, but
> I need to have all translations in 1 file (we have built-in language editor
> in our application)
>
> Is it possible to localize the button on "Application level"?
>
>
> On Thu, Dec 10, 2015 at 10:38 PM, Sebastien  wrote:
>
> > Hi Maxim,
> >
> > This is because default wizard's button values are already defined in
> > AbstractWizard.properties. So it can be overridden in *MyPage*.properties
> > or *MyWizard*.properties, but not in *MyApplication*.property.
> >
> > I don't know how to tell *MyApplication*.property to take precedence over
> > *MyComponent.properties*. Maybe this is a question for users@ ! :)
> >
> > Best regards,
> > Sebastien.
> >
> >
> > On Thu, Dec 10, 2015 at 5:03 AM, Maxim Solodovnik 
> > wrote:
> >
> >> Hello Sebastien,
> >>
> >> not sure which list need to be CC here :(
> >> I have question regarding jqueryui wizard button localization, I need to
> >> localize "Finish" button
> >> I have added string on "Application" level (Application.properties.xml
> >> file)
> >> bla-bla
> >> and seems to have no effect
> >>
> >> this http://www.7thweb.net/wicket-jquery-ui/wizard/DefaultWizardPage
> >> page states I need to create  *MyPage*.properties or *MyWizard*
> >> .properties, but I need to have all translations in 1 file (we have
> >> built-in language editor in our application)
> >>
> >> Is it possible to localize the button on "Application level"?
> >>
> >> --
> >> WBR
> >> Maxim aka solomax
> >>
> >
> >
>
>
> --
> WBR
> Maxim aka solomax
>


Re: ExternalImage

2015-12-10 Thread Martin Grigorov
On Thu, Dec 10, 2015 at 7:43 PM, Tobias Soloschenko <
tobiassolosche...@googlemail.com> wrote:

> Hi there,
>
> If you want to use the SNAPSHOT version I think you have to configure the
> SNAPSHOT repository first:
>
> http://repository.apache.org/snapshots/
>
> @all: I haven't found the information on the page. Maybe we have to readd
> this to the new one.
>

You mean in the new site?
Yes, I think it is a useful information.
Usually when someone asks in the mailing lists I recommend to download the
quickstart and use its pom.xml.


>
> WDYT?
>
> kind regards
>
> Tobias
>
> Am Donnerstag, 10. Dezember 2015 schrieb Sebastien :
>
> > Hi,
> >
> > ExternalImage will be available in 7.2.0. It is currently available in
> > 7.2.0-SNAPSHOT.
> >
> > Best regards,
> > Sebastien
> >
> > On Thu, Dec 10, 2015 at 10:17 AM, xesj.hu  > > wrote:
> >
> > > Hi !
> > >
> > > I use wicket 7.1 with this code, but I get compile error!
> > >
> > > org.apache.wicket.markup.html.image.ExternalImage x;
> > >
> > > ExternalImage is exists in the documentation.
> > >
> > > Bye, xesj.hu
> > >
> >
>


Re: relative or absolute redirects (use in proxy?)

2015-12-10 Thread Rob Audenaerde
Hi Martin,

Thanks for the reply, I will look into it!

-Rob

Verstuurd vanaf mijn iPad

> Op 10 dec. 2015 om 21:42 heeft Martin Grigorov  het 
> volgende geschreven:
> 
> Hi,
> 
> In short: you need a reverse proxy.
> 
> Longer story:
> 
> It is a bit blurry for me now because I did it one year ago but here is
> what I did for one of my applications that is deployed at Azure:
> 1) created 3 images (Ubuntu), named "ubuntu1", "ubuntu2", ...
> 2) each of them runs Tomcat (for the Wicket app) on ports 8081, 8082, 8083
> respectively. Tomcat listen on somemagicurl.cloud.net
> 2.1) these ports are opened only in my Azure account (don't remember the
> exact term for my private network at Azure)
> 3) each image also runs Nginx at port 80, as a proxy.
> 3.1) each Nginx knows about the three Tomcat (for failover)
> 3.2) Azure load balancer balances the Nginx instances, so they serve
> www.myrealapp.com
> 3.3) Nginx config uses reverse proxy to fix the urls coming from Tomcats
> 
> 
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
> 
> On Thu, Dec 10, 2015 at 8:48 PM, Rob Audenaerde 
> wrote:
> 
>> Hi all,
>> 
>> I'm trying to host a Wicket Application in an Azure cloud environment. A
>> third party with Azure knowledge (which I lack atm) put up a proxy for us
>> that enforces 2factor authentication. If the user is allowed in, the
>> traffic is send to our application.
>> 
>> That way we don't have to spend too much time internet-hardening* our
>> application, while still being able to run it in the cloud.
>> 
>> However, it seems Wicket (/Jetty?) is redirecting to browser to absolute
>> urls, and these are not reachable from the browser.
>> 
>> For example, our app runs at somemagicurl222343.cloud.net, and is
>> available
>> at proxy url: client-proxy.cloud.net.  Redirects are given to
>> somemagicurl222343.cloud.net, which is not directly reachable.
>> 
>> What would be the 'proper' solution?
>> 
>> I think the proxy might rewrite redirects (not sure how), but maybe
>> relative redirects would solve the issue as well?
>> 
>> 
>> 
>> *we stick to OWASP etc. as much as possible, but it is sensitive data so we
>> try to be on the safer side by keeping the application behind a fence.
>> 

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Wizard localization

2015-12-10 Thread Sebastien
Hi Martin,

> I think Wizard[_lang].properties should be moved to
org/apache/wicket/extensions/Initializer[_lang].properties

I didn't know (or absolutely forgot) about Initializer[_lang].properties!
It is a better solution IMO, I will change this in AbstractWizard (Wicket
jQuery UI)...
You're are also right that the problem may arise in Wicket Extensions... If
I have time this WE - and if the solution is agreed - I will try to change
in Wicket Extension too...

Thanks & best regards,
Sebastien.


On Thu, Dec 10, 2015 at 9:50 PM, Martin Grigorov 
wrote:

> Hi Maxim,
>
> The order of the loaders is defined at:
>
> https://github.com/apache/wicket/blob/master/wicket-core/src/main/java/org/apache/wicket/settings/ResourceSettings.java#L220-L224
> You can redefine it by using #getStringResourceLoaders().clear();
> #getStringResourceLoaders().addAll(betterOrderedList);
>
> This is a nasty hack! I agree!
>
> I think Wizard[_lang].properties should be moved
> to org/apache/wicket/extensions/Initializer[_lang].properties
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>


Re: ExternalImage

2015-12-10 Thread Tobias Soloschenko
Hi there,

If you want to use the SNAPSHOT version I think you have to configure the
SNAPSHOT repository first:

http://repository.apache.org/snapshots/

@all: I haven't found the information on the page. Maybe we have to readd
this to the new one.

WDYT?

kind regards

Tobias

Am Donnerstag, 10. Dezember 2015 schrieb Sebastien :

> Hi,
>
> ExternalImage will be available in 7.2.0. It is currently available in
> 7.2.0-SNAPSHOT.
>
> Best regards,
> Sebastien
>
> On Thu, Dec 10, 2015 at 10:17 AM, xesj.hu  > wrote:
>
> > Hi !
> >
> > I use wicket 7.1 with this code, but I get compile error!
> >
> > org.apache.wicket.markup.html.image.ExternalImage x;
> >
> > ExternalImage is exists in the documentation.
> >
> > Bye, xesj.hu
> >
>


Re: Wizard localization

2015-12-10 Thread Maxim Solodovnik
Thanks Sebastien :)

Hello All,

I would like to redefine wizard button on "Application level", maybe
someone can suggest how it can be possible to redefine string resource
resolution order?

Here is the original question:
I have question regarding jqueryui wizard button localization, I need to
localize "Finish" button
I have added string on "Application" level (Application.properties.xml file)
bla-bla
and seems to have no effect

this http://www.7thweb.net/wicket-jquery-ui/wizard/DefaultWizardPage page
states I need to create  *MyPage*.properties or *MyWizard*.properties, but
I need to have all translations in 1 file (we have built-in language editor
in our application)

Is it possible to localize the button on "Application level"?


On Thu, Dec 10, 2015 at 10:38 PM, Sebastien  wrote:

> Hi Maxim,
>
> This is because default wizard's button values are already defined in
> AbstractWizard.properties. So it can be overridden in *MyPage*.properties
> or *MyWizard*.properties, but not in *MyApplication*.property.
>
> I don't know how to tell *MyApplication*.property to take precedence over
> *MyComponent.properties*. Maybe this is a question for users@ ! :)
>
> Best regards,
> Sebastien.
>
>
> On Thu, Dec 10, 2015 at 5:03 AM, Maxim Solodovnik 
> wrote:
>
>> Hello Sebastien,
>>
>> not sure which list need to be CC here :(
>> I have question regarding jqueryui wizard button localization, I need to
>> localize "Finish" button
>> I have added string on "Application" level (Application.properties.xml
>> file)
>> bla-bla
>> and seems to have no effect
>>
>> this http://www.7thweb.net/wicket-jquery-ui/wizard/DefaultWizardPage
>> page states I need to create  *MyPage*.properties or *MyWizard*
>> .properties, but I need to have all translations in 1 file (we have
>> built-in language editor in our application)
>>
>> Is it possible to localize the button on "Application level"?
>>
>> --
>> WBR
>> Maxim aka solomax
>>
>
>


-- 
WBR
Maxim aka solomax


Re: ExternalImage

2015-12-10 Thread Tobias Soloschenko
Then I'm going to add it. :-)

kind regards

Tobias

> Am 10.12.2015 um 21:44 schrieb Martin Grigorov :
> 
> On Thu, Dec 10, 2015 at 7:43 PM, Tobias Soloschenko <
> tobiassolosche...@googlemail.com> wrote:
> 
>> Hi there,
>> 
>> If you want to use the SNAPSHOT version I think you have to configure the
>> SNAPSHOT repository first:
>> 
>> http://repository.apache.org/snapshots/
>> 
>> @all: I haven't found the information on the page. Maybe we have to readd
>> this to the new one.
> 
> You mean in the new site?
> Yes, I think it is a useful information.
> Usually when someone asks in the mailing lists I recommend to download the
> quickstart and use its pom.xml.
> 
> 
>> 
>> WDYT?
>> 
>> kind regards
>> 
>> Tobias
>> 
>> Am Donnerstag, 10. Dezember 2015 schrieb Sebastien :
>> 
>>> Hi,
>>> 
>>> ExternalImage will be available in 7.2.0. It is currently available in
>>> 7.2.0-SNAPSHOT.
>>> 
>>> Best regards,
>>> Sebastien
>>> 
>>> On Thu, Dec 10, 2015 at 10:17 AM, xesj.hu >> > wrote:
>>> 
 Hi !
 
 I use wicket 7.1 with this code, but I get compile error!
 
 org.apache.wicket.markup.html.image.ExternalImage x;
 
 ExternalImage is exists in the documentation.
 
 Bye, xesj.hu
>> 

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org