RE: [OT] Regular Expression for Validator

2002-09-27 Thread John Sherlock

try the regex mailing list!



John Sherlock
Software Engineer 



Macalla Software Ltd19 Raglan Road 
Tel: +353-1-6642268 Ballsbridge
Fax: +353-1-6642213 Dublin 4
Mobile: +353 86 8630867 Ireland

Email:  [EMAIL PROTECTED]
Web:www.macalla.com
WAP:www.macalla.com/wap/index.wml



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




RE: Newbie Question

2002-09-20 Thread John Sherlock

> Should all JSP pages be executed through the controller?  Even those that
are external to an application that requires a login?

"Even those that are external to an application that requires a login?"

hmmm, do you mean there are certain parts of your application that require a
user to login in order to access them and certain parts that don't? If this
is the case and all your JSPs are part of the one Struts application then
yes, you should use the controller to routing all your requests. The nature
of the MVC framework is that all requests are routed through the controller
becuase it is the responsibility of the controller to select the next view
for the client. So regardless of whether or not authentication is required
for a user to perform an action, the request should still be routed via the
controller. Even if one JSP simply links to another you can still route the
request throught the controller by using the "ForwardAction" that is
provided with the struts framework. See Chapter 5, page 19 of Chuck
Cavaness' book which is available for download at
http://www.theserverside.com/resources/strutsreview.jsp. As a newbie myself
i would strongly recommend reading this book before attempting to do any
serious Struts development.

Regards,

Jonny :)


John Sherlock

Software Engineer 
Macalla Software Ltd

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




RE: Backtracking & Breadcrumbs

2002-09-20 Thread John Sherlock

>I was kind of hoping for something at a "higher level", 
>that once set up would just work. I guess I could override 
>the Action class, but I'm not sure how to go about doing 
>it that way.

Howard,

Here's a bit of a dirty hack... if you extend the Action class you could
possibly add the functionality to find out what page you have just come from
and set the name of that page in the session. That way the next page could
just recall the name of the previous page from the session. Because it is
done in the Action class it will always be done so you don't have to worry
about it.

In your custom Action class you can use 

String strReferringPage = request.getHeader("Referer"); 

to get the URL of the page you have just come from. Then you can set the
referring page in the session using 

session.setAttribute("previousPage", strReferringPage);

- not sure if 'request.getHeader("Referer")' will always achieve the desired
effect. If doesn't work you could have a hidden field on each form called
'referringPage' with the value being the name of that page. You could pull
this value out of the request in the Action class and set it in the session
in the same way as above. The drawback with this approach is that you have
to remember to put the hidden field on each page and in the case of pages
with no form and just a link, you will have to append
?referringPage=[nameOfPage] to all your hrefs. You could possibly eliminate
the need to do this yourself by writing a custom link tag and form tag
(extending the tags in the html-tags lib) that will do it for you but that
could be more trouble than it's worth.

Extending the Action class is quite simple - a good explanation on how to do
it can be found in chapter 5 (page 3) of Chuck Cavaness' book on Struts.
http://www.theserverside.com/resources/strutsreview.jsp .

Regards,

Jonny :)


John Sherlock

Software Engineer 
Macalla Software Ltd

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




Dynamically set the 'value' attribute of element...??

2002-09-19 Thread John Sherlock

Hi,

I'm new to struts development so this should be a no-brainer for someone...

I have an object in the session and i need to access the object to set the
'value' attribute of a  element. I can set the value of an
ordinary html  tag using the  tag as follows...

">

...but i can't use the same approach to set the 'value' attribute of a
 tag as it requires putting one tag-lib tag inside the other...

"/>

is there a simple way of doing this? 

Thanks in advance,

Jonny :)

Software Engineer 
Macalla Software Ltd

--
To unsubscribe, e-mail:   
For additional commands, e-mail: