Marco,
There are of course multiple ways of doing this, which also depends on how
you implement your "Action".
To me there two aspects of control:
1.what page should be given to the user next.
2.what version (based on user's view) of the page should they see.
I leave the 1st element of control within the "Action", which I am
implementing via JPython script.
The second element (decoding the logical to physical page) I leave in the
actuall Controller servlet.
So the action should have very little code but its should:
1.Manipulate the Data Layer
2.Direct the user's request to a "logical page".
In my implementation I simply return a variable to the Controller servlet of
which "logical" page to go to next.
The Controller then looks inside a Hashtable (Or call UI data in SQL
database in Development Mode) to find the actual page to go to next.
For example: String _actual_page = (String) m_pages.get("[logical form
name].[user's view name]");
You can then forward the request to the actual JSP page.
Typically this hashtable should be loaded by reading the UI data froma
database when the Controller is initialized.
This is one example and I am not sure if everyone needs this type of
functionality.
Thanks,
Shone
Developer
Q-Link Technologies
http://www.qlinktech.com
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, April 11, 2000 6:08 AM
Subject: RE: More on Model 2/little confused
> Hi Shone,
> thanx for your answer....but i am still confused about one thing:
> how can i maintain that metadata?? Craig was saying about some public
method
> in the servlet ....but my question is still
> how can i implement it?? suppose that i have the data stored in an
hashtable
> in the servlet...then how and when i
> communicate to the Action class the URL of the JSP??
> hope that u can help me
> regards
> marco
>
> > -----Original Message-----
> > From: EXT Shone Sadler [mailto:[EMAIL PROTECTED]]
> > Sent: 11. April 2000 13:54
> > To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> > Subject: Re: More on Model 2/little confused
> >
> >
> > Marco,
> >
> > I will comment on your first question about the logical page.
> > Here is the benefit I get out of using a logical page. (Note
> > I am assuming
> > this is an application where a user logs in) You can provide
> > different
> > views to the system in a database driven approach.
> > You do this by maintaining UI meta data.
> > For example the entities may include:
> > page (A page reflecting each logical page in your site)
> > oid (PK)
> > name
> > page_version (
> > oid (PK)
> > name
> > text --The Actual JSP or a Absolute path reference
> > page_version2page -- FK referencing back to logical page
> >
> > view (Each user in the system is related to a view)
> > oid (PK)
> > name
> >
> > view2page_version (This table does the "magic", you can
> > now return the
> > page_version (Actual Physical page) for any given view and
> > logical page
> > view_oid
> > page_oid
> > page_version_oid
> >
> >
> > This gives you (or your users) the ability "Overide" a page by:
> > 1. creating a new view of the system.
> > 2. Inserting a record for the new view, the logical page
> > and the the new
> > page_Version(they just created) in the view2page_version table
> > 3.Relating users to the new view.
> >
> > Here is a DFD of my approach.
> >
> >
> > Hope this makes sense.
> > Shone Sadler
> > Developer
> > Q-Link Technologies
> > http://www.qlinktech.com
> >
> > ----- Original Message -----
> > From: Mistroni Marco <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Tuesday, April 11, 2000 4:39 AM
> > Subject: More on Model 2/little confused
> >
> >
> > > Hi All,
> > > i have followed many threads about Model 2
> > architecture, and at
> > the
> > > hand i got
> > > this picture(please correct me if i am wrong) listed below
> > shortly :
> > > - JSP 'sends' the request to the Servlet/controller
> > > - based on 'path info' the Servlet fetches from an
> > Hashtable the correct
> > > Action class to instantiate
> > > - action class does the logic, populates a JavaBean and
> > send the request
> > to
> > > the JSP
> > > - the JSP fetches the request data and present it to the User
> > >
> > > Well, in this scenario something is not clear to me:
> > > - how can the Action class know the URL of the JSP page to send the
> > > response??? i don't want to hardcode it into the java
> > class, and in one
> > > thread Craig McClanahan wrote
> > >
> > > >Now, I tend to add a public method in my controller
> > servlet that can look
> > > up actual page names from a logical name (as >someone else in this
> > thread
> > > recommended).
> > >
> > > well i did not get this idea......could u pls explain me more?? for
> > example,
> > > suppose that i store all the URL of the JSP in the config
> > file..and then
> > > populate (in the init() of the servlet) an Hashtable with all the
> > > URL....then when i communicate it to the Action?? do i say it when i
> > create
> > > the Action class that i am going to use???
> > >
> > > the other thing that is not clear is:
> > > - how can i use a single instance of the various Action
> > classes that i am
> > > going to use??? sorry for this question, but i don't know much about
> > > performance............will i have much disadvantages if i
> > instantiate
> > > every request a new Action class??
> > >
> > > can anyone that got the picture explain it better to me??
> > >
> > > sorry Craig, Kevin and Daniel for bothering again...
> > >
> > > thanx to all in advance
> > > best regards
> > > marco
> > >
> > >
> > ==============================================================
> > =============
> > > To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> > JSP-INTEREST".
> > > Some relevant FAQs on JSP/Servlets can be found at:
> > >
> > > http://java.sun.com/products/jsp/faq.html
> > > http://www.esperanto.org.nz/jsp/jspfaq.html
> > > http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> > > http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
> > >
> > >
> >
>
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets