You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@beehive.apache.org by Li <am...@gmail.com> on 2006/05/19 10:41:48 UTC

How to prevent direct access to page

Hi all,

Any idea on preventing direct access to page, say, only allow "abc.do" but
not "a/b/c/abc.jsp"?

Regards

Re: How to prevent direct access to page

Posted by Eddie O'Neil <ek...@gmail.com>.
Li--

  FWIW, efficiency isn't really an issue here as the Page Flows
compile into .class files and some XML resources (Struts config files,
validator config files, etc).  The VM is certainly capable of loading
each of the .class files and the resources; I wouldn't expect that
this would be an issue for your application.

  As far as the "tall"-ness, you can certainly put Page Flows into
nested directories like:

  /a
    Controller.java
    b/
      Controller.java
      c/
        Controller.java

and so on.

  Hope that helps.

Eddie


On 5/21/06, Thomas Cook <th...@gmail.com> wrote:
> You can only have one standard page flow per directory.  Each
> directory maps to a corresponding directory under your web content
> directory that contains that flow's related pages.  As far as the
> efficiency of this goes, I can't speak to that, but I would think each
> page flow's efficiency would be roughly the same as a Struts module
> (since that's what they map to underneath it all).
>
> If you have 50 page flows then it seems it would get fairly "tall",
> but that may just be the case because you have a large app, or maybe
> I'm not real clear what you're trying to avoid.  You might be able to
> have some of your page flows become larger flows if that feels like
> the right compromise.
>
>
> On 5/21/06, Li <am...@gmail.com> wrote:
> > Yeah,
> >
> > I 'd tried group all controllers into a folder. But when i created many
> > flows (in my mind), the controller "tree" became very "tall". It looks like
> > as following:
> >      /Controller
> >          |__________ /Login (Controller)
> >          |__________/ Process1 (Controller)
> >          |__________/ Process2 ....
> >          ........
> >          |__________/ Process 50
> >
> > It involves a lot of file I/O work during runtime. Would be any more
> > efficient way or is it possible to just put all controllers into one folder
> > "e.g. /Controller" and rename Login controller as LoginController. (I tried
> > to do that, it doesnt work, i guess maybe i didnt find a correct way to do
> > that)
> >
> > BTW, thanks for your suggestion on the Login module, Exception cost is
> > expensive in Java, if the login page is redirected cuz of the exception
> > handling, I 'd rather just use redirect or forward.
> >
> > Regards
> >
> > Li
> >
> > On 5/20/06, Thomas Cook <th...@gmail.com> wrote:
> > >
> > > Your observation that each folder typically has a controller is
> > > correct.  In page flow thinking, a "section" is a folder.
> > >
> > > On 5/19/06, Li <am...@gmail.com> wrote:
> > > > Hi, thanks for replying,
> > > >
> > > > I added any a filter into web.xml:
> > > > <filter-mapping>
> > > >         <filter-name>PageFlowForbiddenFilter</filter-name>
> > > >         <url-pattern>*.jsp</url-pattern>
> > > >         <dispatcher>FORWARD</dispatcher>
> > > >         <dispatcher>REQUEST</dispatcher>
> > > >         <dispatcher>INCLUDE</dispatcher>
> > > > </filter-mapping>
> > > >
> > > > It works fine.
> > > >
> > > > Is it a must that every single functional folder should have its own
> > > > controller?
> > > > such like: /login --> Controller for login process
> > > >                /profile --> Controller for profile
> > > create->confirm->submit
> > > > process ...
> > > >
> > > > Is it possible to just have one controller which controls all processes
> > > > section by section?
> > > >
> > > > On 5/19/06, AndreasWuest <An...@gmx.de> wrote:
> > > > >
> > > > > In order to achieve that, you have to put your jsp pages under the
> > > > > WEB-INF directory. This works at
> > > > > least for "normal" web application using struts. don't know if this
> > > > > works with beehive as well, but i think so.
> > > > >
> > > > > regards,
> > > > > Andreas
> > > > >
> > > > > > Hi all,
> > > > > >
> > > > > > Any idea on preventing direct access to page, say, only allow "
> > > abc.do"
> > > > > > but
> > > > > > not "a/b/c/abc.jsp"?
> > > > > >
> > > > > > Regards
> > > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > =====================================
> > > > The world will be ended if love is everywhere.
> > > >                                                ---- Shawzi
> > > >
> > > >
> > >
> >
> >
> >
> > --
> > =====================================
> > The world will be ended if love is everywhere.
> >                                                ---- Shawzi
> >
> >
>

Re: How to prevent direct access to page

Posted by Li <am...@gmail.com>.
Hi, guys,

Thanks for your comments. I 'd just played with Beehive for few days. I like
its page flow concept. Actually I am a struts webapp developer. You guys may
have been swimming in the beehive water for quite a while. Would you mind
share your thoughts about Struts vs Beehive?

Since Beehive is now built on top of Struts. It is now depending on it.
Beehive is more like a enhancement of Struts on flow controls. But based now
my experience now. Beehive does really reduce the development time. And
again, each process has its own controller, the maintainability is becoming
more costly and also increasing the complexibility of webapp ...


On 5/22/06, Li <ampyx.li@gmail.com > wrote:
>
> Right, thanks for your comments Thomas. And have a nice day.
>
>
>
> On 5/22/06, Thomas Cook < thomas.cook@gmail.com > wrote:
> >
> > You can only have one standard page flow per directory.  Each
> > directory maps to a corresponding directory under your web content
> > directory that contains that flow's related pages.  As far as the
> > efficiency of this goes, I can't speak to that, but I would think each
> > page flow's efficiency would be roughly the same as a Struts module
> > (since that's what they map to underneath it all).
> >
> > If you have 50 page flows then it seems it would get fairly "tall",
> > but that may just be the case because you have a large app, or maybe
> > I'm not real clear what you're trying to avoid.  You might be able to
> > have some of your page flows become larger flows if that feels like
> > the right compromise.
> >
> >
> > On 5/21/06, Li < ampyx.li@gmail.com> wrote:
> > > Yeah,
> > >
> > > I 'd tried group all controllers into a folder. But when i created
> > many
> > > flows (in my mind), the controller "tree" became very "tall". It looks
> > like
> > > as following:
> > >      /Controller
> > >          |__________ /Login (Controller)
> > >          |__________/ Process1 (Controller)
> > >          |__________/ Process2 ....
> > >          ........
> > >          |__________/ Process 50
> > >
> > > It involves a lot of file I/O work during runtime. Would be any more
> > > efficient way or is it possible to just put all controllers into one
> > folder
> > > "e.g. /Controller" and rename Login controller as LoginController. (I
> > tried
> > > to do that, it doesnt work, i guess maybe i didnt find a correct way
> > to do
> > > that)
> > >
> > > BTW, thanks for your suggestion on the Login module, Exception cost is
> > > expensive in Java, if the login page is redirected cuz of the
> > exception
> > > handling, I 'd rather just use redirect or forward.
> > >
> > > Regards
> > >
> > > Li
> > >
> > > On 5/20/06, Thomas Cook < thomas.cook@gmail.com> wrote:
> > > >
> > > > Your observation that each folder typically has a controller is
> > > > correct.  In page flow thinking, a "section" is a folder.
> > > >
> > > > On 5/19/06, Li < ampyx.li@gmail.com> wrote:
> > > > > Hi, thanks for replying,
> > > > >
> > > > > I added any a filter into web.xml:
> > > > > <filter-mapping>
> > > > >         <filter-name>PageFlowForbiddenFilter</filter-name>
> > > > >         <url-pattern>*.jsp</url-pattern>
> > > > >         <dispatcher>FORWARD</dispatcher>
> > > > >         <dispatcher>REQUEST</dispatcher>
> > > > >         <dispatcher>INCLUDE</dispatcher>
> > > > > </filter-mapping>
> > > > >
> > > > > It works fine.
> > > > >
> > > > > Is it a must that every single functional folder should have its
> > own
> > > > > controller?
> > > > > such like: /login --> Controller for login process
> > > > >                /profile --> Controller for profile
> > > > create->confirm->submit
> > > > > process ...
> > > > >
> > > > > Is it possible to just have one controller which controls all
> > processes
> > > > > section by section?
> > > > >
> > > > > On 5/19/06, AndreasWuest < AndreasWuest@gmx.de> wrote:
> > > > > >
> > > > > > In order to achieve that, you have to put your jsp pages under
> > the
> > > > > > WEB-INF directory. This works at
> > > > > > least for "normal" web application using struts. don't know if
> > this
> > > > > > works with beehive as well, but i think so.
> > > > > >
> > > > > > regards,
> > > > > > Andreas
> > > > > >
> > > > > > > Hi all,
> > > > > > >
> > > > > > > Any idea on preventing direct access to page, say, only allow
> > "
> > > > abc.do"
> > > > > > > but
> > > > > > > not "a/b/c/abc.jsp"?
> > > > > > >
> > > > > > > Regards
> > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > =====================================
> > > > > The world will be ended if love is everywhere.
> > > > >                                                ---- Shawzi
> > > > >
> > > > >
> > > >
> > >
> > >
> > >
> > > --
> > > =====================================
> > > The world will be ended if love is everywhere.
> > >                                                ---- Shawzi
> > >
> > >
> >
>
>
>
> --
>
> =====================================
> The world will be ended if love is everywhere.
>                                                ---- Shawzi
>



-- 
=====================================
The world will be ended if love is everywhere.
                                               ---- Shawzi

Re: How to prevent direct access to page

Posted by Li <am...@gmail.com>.
Right, thanks for your comments Thomas. And have a nice day.


On 5/22/06, Thomas Cook <th...@gmail.com> wrote:
>
> You can only have one standard page flow per directory.  Each
> directory maps to a corresponding directory under your web content
> directory that contains that flow's related pages.  As far as the
> efficiency of this goes, I can't speak to that, but I would think each
> page flow's efficiency would be roughly the same as a Struts module
> (since that's what they map to underneath it all).
>
> If you have 50 page flows then it seems it would get fairly "tall",
> but that may just be the case because you have a large app, or maybe
> I'm not real clear what you're trying to avoid.  You might be able to
> have some of your page flows become larger flows if that feels like
> the right compromise.
>
>
> On 5/21/06, Li <am...@gmail.com> wrote:
> > Yeah,
> >
> > I 'd tried group all controllers into a folder. But when i created many
> > flows (in my mind), the controller "tree" became very "tall". It looks
> like
> > as following:
> >      /Controller
> >          |__________ /Login (Controller)
> >          |__________/ Process1 (Controller)
> >          |__________/ Process2 ....
> >          ........
> >          |__________/ Process 50
> >
> > It involves a lot of file I/O work during runtime. Would be any more
> > efficient way or is it possible to just put all controllers into one
> folder
> > "e.g. /Controller" and rename Login controller as LoginController. (I
> tried
> > to do that, it doesnt work, i guess maybe i didnt find a correct way to
> do
> > that)
> >
> > BTW, thanks for your suggestion on the Login module, Exception cost is
> > expensive in Java, if the login page is redirected cuz of the exception
> > handling, I 'd rather just use redirect or forward.
> >
> > Regards
> >
> > Li
> >
> > On 5/20/06, Thomas Cook <th...@gmail.com> wrote:
> > >
> > > Your observation that each folder typically has a controller is
> > > correct.  In page flow thinking, a "section" is a folder.
> > >
> > > On 5/19/06, Li <am...@gmail.com> wrote:
> > > > Hi, thanks for replying,
> > > >
> > > > I added any a filter into web.xml:
> > > > <filter-mapping>
> > > >         <filter-name>PageFlowForbiddenFilter</filter-name>
> > > >         <url-pattern>*.jsp</url-pattern>
> > > >         <dispatcher>FORWARD</dispatcher>
> > > >         <dispatcher>REQUEST</dispatcher>
> > > >         <dispatcher>INCLUDE</dispatcher>
> > > > </filter-mapping>
> > > >
> > > > It works fine.
> > > >
> > > > Is it a must that every single functional folder should have its own
> > > > controller?
> > > > such like: /login --> Controller for login process
> > > >                /profile --> Controller for profile
> > > create->confirm->submit
> > > > process ...
> > > >
> > > > Is it possible to just have one controller which controls all
> processes
> > > > section by section?
> > > >
> > > > On 5/19/06, AndreasWuest <An...@gmx.de> wrote:
> > > > >
> > > > > In order to achieve that, you have to put your jsp pages under the
> > > > > WEB-INF directory. This works at
> > > > > least for "normal" web application using struts. don't know if
> this
> > > > > works with beehive as well, but i think so.
> > > > >
> > > > > regards,
> > > > > Andreas
> > > > >
> > > > > > Hi all,
> > > > > >
> > > > > > Any idea on preventing direct access to page, say, only allow "
> > > abc.do"
> > > > > > but
> > > > > > not "a/b/c/abc.jsp"?
> > > > > >
> > > > > > Regards
> > > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > =====================================
> > > > The world will be ended if love is everywhere.
> > > >                                                ---- Shawzi
> > > >
> > > >
> > >
> >
> >
> >
> > --
> > =====================================
> > The world will be ended if love is everywhere.
> >                                                ---- Shawzi
> >
> >
>



-- 
=====================================
The world will be ended if love is everywhere.
                                               ---- Shawzi

Re: How to prevent direct access to page

Posted by Thomas Cook <th...@gmail.com>.
You can only have one standard page flow per directory.  Each
directory maps to a corresponding directory under your web content
directory that contains that flow's related pages.  As far as the
efficiency of this goes, I can't speak to that, but I would think each
page flow's efficiency would be roughly the same as a Struts module
(since that's what they map to underneath it all).

If you have 50 page flows then it seems it would get fairly "tall",
but that may just be the case because you have a large app, or maybe
I'm not real clear what you're trying to avoid.  You might be able to
have some of your page flows become larger flows if that feels like
the right compromise.


On 5/21/06, Li <am...@gmail.com> wrote:
> Yeah,
>
> I 'd tried group all controllers into a folder. But when i created many
> flows (in my mind), the controller "tree" became very "tall". It looks like
> as following:
>      /Controller
>          |__________ /Login (Controller)
>          |__________/ Process1 (Controller)
>          |__________/ Process2 ....
>          ........
>          |__________/ Process 50
>
> It involves a lot of file I/O work during runtime. Would be any more
> efficient way or is it possible to just put all controllers into one folder
> "e.g. /Controller" and rename Login controller as LoginController. (I tried
> to do that, it doesnt work, i guess maybe i didnt find a correct way to do
> that)
>
> BTW, thanks for your suggestion on the Login module, Exception cost is
> expensive in Java, if the login page is redirected cuz of the exception
> handling, I 'd rather just use redirect or forward.
>
> Regards
>
> Li
>
> On 5/20/06, Thomas Cook <th...@gmail.com> wrote:
> >
> > Your observation that each folder typically has a controller is
> > correct.  In page flow thinking, a "section" is a folder.
> >
> > On 5/19/06, Li <am...@gmail.com> wrote:
> > > Hi, thanks for replying,
> > >
> > > I added any a filter into web.xml:
> > > <filter-mapping>
> > >         <filter-name>PageFlowForbiddenFilter</filter-name>
> > >         <url-pattern>*.jsp</url-pattern>
> > >         <dispatcher>FORWARD</dispatcher>
> > >         <dispatcher>REQUEST</dispatcher>
> > >         <dispatcher>INCLUDE</dispatcher>
> > > </filter-mapping>
> > >
> > > It works fine.
> > >
> > > Is it a must that every single functional folder should have its own
> > > controller?
> > > such like: /login --> Controller for login process
> > >                /profile --> Controller for profile
> > create->confirm->submit
> > > process ...
> > >
> > > Is it possible to just have one controller which controls all processes
> > > section by section?
> > >
> > > On 5/19/06, AndreasWuest <An...@gmx.de> wrote:
> > > >
> > > > In order to achieve that, you have to put your jsp pages under the
> > > > WEB-INF directory. This works at
> > > > least for "normal" web application using struts. don't know if this
> > > > works with beehive as well, but i think so.
> > > >
> > > > regards,
> > > > Andreas
> > > >
> > > > > Hi all,
> > > > >
> > > > > Any idea on preventing direct access to page, say, only allow "
> > abc.do"
> > > > > but
> > > > > not "a/b/c/abc.jsp"?
> > > > >
> > > > > Regards
> > > > >
> > > >
> > > >
> > > >
> > >
> > >
> > > --
> > > =====================================
> > > The world will be ended if love is everywhere.
> > >                                                ---- Shawzi
> > >
> > >
> >
>
>
>
> --
> =====================================
> The world will be ended if love is everywhere.
>                                                ---- Shawzi
>
>

Re: How to prevent direct access to page

Posted by Li <am...@gmail.com>.
Yeah,

I 'd tried group all controllers into a folder. But when i created many
flows (in my mind), the controller "tree" became very "tall". It looks like
as following:
     /Controller
         |__________ /Login (Controller)
         |__________/ Process1 (Controller)
         |__________/ Process2 ....
         ........
         |__________/ Process 50

It involves a lot of file I/O work during runtime. Would be any more
efficient way or is it possible to just put all controllers into one folder
"e.g. /Controller" and rename Login controller as LoginController. (I tried
to do that, it doesnt work, i guess maybe i didnt find a correct way to do
that)

BTW, thanks for your suggestion on the Login module, Exception cost is
expensive in Java, if the login page is redirected cuz of the exception
handling, I 'd rather just use redirect or forward.

Regards

Li

On 5/20/06, Thomas Cook <th...@gmail.com> wrote:
>
> Your observation that each folder typically has a controller is
> correct.  In page flow thinking, a "section" is a folder.
>
> On 5/19/06, Li <am...@gmail.com> wrote:
> > Hi, thanks for replying,
> >
> > I added any a filter into web.xml:
> > <filter-mapping>
> >         <filter-name>PageFlowForbiddenFilter</filter-name>
> >         <url-pattern>*.jsp</url-pattern>
> >         <dispatcher>FORWARD</dispatcher>
> >         <dispatcher>REQUEST</dispatcher>
> >         <dispatcher>INCLUDE</dispatcher>
> > </filter-mapping>
> >
> > It works fine.
> >
> > Is it a must that every single functional folder should have its own
> > controller?
> > such like: /login --> Controller for login process
> >                /profile --> Controller for profile
> create->confirm->submit
> > process ...
> >
> > Is it possible to just have one controller which controls all processes
> > section by section?
> >
> > On 5/19/06, AndreasWuest <An...@gmx.de> wrote:
> > >
> > > In order to achieve that, you have to put your jsp pages under the
> > > WEB-INF directory. This works at
> > > least for "normal" web application using struts. don't know if this
> > > works with beehive as well, but i think so.
> > >
> > > regards,
> > > Andreas
> > >
> > > > Hi all,
> > > >
> > > > Any idea on preventing direct access to page, say, only allow "
> abc.do"
> > > > but
> > > > not "a/b/c/abc.jsp"?
> > > >
> > > > Regards
> > > >
> > >
> > >
> > >
> >
> >
> > --
> > =====================================
> > The world will be ended if love is everywhere.
> >                                                ---- Shawzi
> >
> >
>



-- 
=====================================
The world will be ended if love is everywhere.
                                               ---- Shawzi

Re: How to prevent direct access to page

Posted by Thomas Cook <th...@gmail.com>.
Your observation that each folder typically has a controller is
correct.  In page flow thinking, a "section" is a folder.

On 5/19/06, Li <am...@gmail.com> wrote:
> Hi, thanks for replying,
>
> I added any a filter into web.xml:
> <filter-mapping>
>         <filter-name>PageFlowForbiddenFilter</filter-name>
>         <url-pattern>*.jsp</url-pattern>
>         <dispatcher>FORWARD</dispatcher>
>         <dispatcher>REQUEST</dispatcher>
>         <dispatcher>INCLUDE</dispatcher>
> </filter-mapping>
>
> It works fine.
>
> Is it a must that every single functional folder should have its own
> controller?
> such like: /login --> Controller for login process
>                /profile --> Controller for profile create->confirm->submit
> process ...
>
> Is it possible to just have one controller which controls all processes
> section by section?
>
> On 5/19/06, AndreasWuest <An...@gmx.de> wrote:
> >
> > In order to achieve that, you have to put your jsp pages under the
> > WEB-INF directory. This works at
> > least for "normal" web application using struts. don't know if this
> > works with beehive as well, but i think so.
> >
> > regards,
> > Andreas
> >
> > > Hi all,
> > >
> > > Any idea on preventing direct access to page, say, only allow "abc.do"
> > > but
> > > not "a/b/c/abc.jsp"?
> > >
> > > Regards
> > >
> >
> >
> >
>
>
> --
> =====================================
> The world will be ended if love is everywhere.
>                                                ---- Shawzi
>
>

Re: How to prevent direct access to page

Posted by Li <am...@gmail.com>.
Hi, thanks for replying,

I added any a filter into web.xml:
<filter-mapping>
        <filter-name>PageFlowForbiddenFilter</filter-name>
        <url-pattern>*.jsp</url-pattern>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>INCLUDE</dispatcher>
</filter-mapping>

It works fine.

Is it a must that every single functional folder should have its own
controller?
such like: /login --> Controller for login process
               /profile --> Controller for profile create->confirm->submit
process ...

Is it possible to just have one controller which controls all processes
section by section?

On 5/19/06, AndreasWuest <An...@gmx.de> wrote:
>
> In order to achieve that, you have to put your jsp pages under the
> WEB-INF directory. This works at
> least for "normal" web application using struts. don't know if this
> works with beehive as well, but i think so.
>
> regards,
> Andreas
>
> > Hi all,
> >
> > Any idea on preventing direct access to page, say, only allow "abc.do"
> > but
> > not "a/b/c/abc.jsp"?
> >
> > Regards
> >
>
>
>


-- 
=====================================
The world will be ended if love is everywhere.
                                               ---- Shawzi

Re: How to prevent direct access to page

Posted by AndreasWuest <An...@gmx.de>.
In order to achieve that, you have to put your jsp pages under the 
WEB-INF directory. This works at
least for "normal" web application using struts. don't know if this 
works with beehive as well, but i think so.

regards,
Andreas

> Hi all,
>
> Any idea on preventing direct access to page, say, only allow "abc.do" 
> but
> not "a/b/c/abc.jsp"?
>
> Regards
>