Re: Is tile definations Instance is singleton

2006-05-23 Thread Antonio Petrelli

navin mca ha scritto:

Hi Antonio,
   
  Oh boy your English gave me an headache!


  I am really sorry for my bad english.
   
  Following is my tile definition.
   
  definition name=forwardDynamicTile path=/WEB-INF/testLayOut.jsp
  put name=attribute1 value=attribute1Value type=string/ 
  putList name=body
  add value=/WEB-INF/position1.jsp / 
  !--Conditional Include-- 
  
  add value=/WEB-INF/position3.jsp /
  !--Conditional Include-- 
  add value=/WEB-INF/position4.jsp / 
  add value=/WEB-INF/position5.jsp / 
  /putList 
   
  Here 
   
  add value=/WEB-INF/position3.jsp /
   
  is the condional tile which will be added/removed at run time from the tile definition object based on some request flag.
   
  So my query is 
   
  What will happen when there will be multiple calls for the same Tile definition for both form of the tile object(with or without position3.jsp tile)
  


It is a so-called race-condition: it depends what happens first. Anyway 
it will lead you to a 50% chance to have it wrong. How Tiles definitions 
are created depends on the DefinitionsFactory. The default one creates 
definitions for their use in the whole application. Therefore if you 
change it once, it will be changed forever (until you change it again :-P ).
The only way to solve your problem is to implement DefinitionsFactory or 
extend FactorySet class. To configure it modify struts-config.xml this way:


**snip**
 plug-in className=org.apache.struts.tiles.TilesPlugin
   set-property property=definitions-config 
value=/WEB-INF/dimensions-config.xml/

!-- all the rest --
 /plug-in
**snap**
Ciao
Antonio


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



Re: Is tile definations Instance is singleton

2006-05-23 Thread navin mca
Hi Antonio ,
   
  Thanks alot for your help.
   
  Could u pls explain me how following code will help me to solve the race 
condition
   
   plug-in className=org.apache.struts.tiles.TilesPlugin
set-property property=definitions-config 
value=/WEB-INF/dimensions-config.xml/
   
  1. wht should I put in dimensions-config.xml file (Do you want to say that I 
should put my tile definition in it which is having such complex accessing 
problem.)
   
  2. wht should I do to implement DefinitionsFactory or extend FactorySet , I 
had read the documentation but there is no much help regarding these classes.

  Do u want to say that after making above configuration in the struts config 
file FactorySet will be automatically implemented by struts and one request 
will be served by one exclusive instance of the same tile definition file.
   
  if not then let me explain or direct me to some example or tutorial.
   
  Hope my queries are sensible to you.
   
  regards,
  Novin
   
   
  

Antonio Petrelli [EMAIL PROTECTED] wrote:
  navin mca ha scritto:
 Hi Antonio,
 
 Oh boy your English gave me an headache!

 I am really sorry for my bad english.
 
 Following is my tile definition.
 
 
 


 

 
 
 
 
 
 
 
 

 
 Here 
 
 
 
 is the condional tile which will be added/removed at run time from the tile 
 definition object based on some request flag.
 
 So my query is 
 
 What will happen when there will be multiple calls for the same Tile 
 definition for both form of the tile object(with or without position3.jsp 
 tile)
 

It is a so-called race-condition: it depends what happens first. Anyway 
it will lead you to a 50% chance to have it wrong. How Tiles definitions 
are created depends on the DefinitionsFactory. The default one creates 
definitions for their use in the whole application. Therefore if you 
change it once, it will be changed forever (until you change it again :-P ).
The only way to solve your problem is to implement DefinitionsFactory or 
extend FactorySet class. To configure it modify struts-config.xml this way:

**snip**


value=/WEB-INF/dimensions-config.xml/



**snap**
Ciao
Antonio


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




Thanks and Regards, 
Novin Jaiswal 
+919890089443(M) 
+912039511388(H) 
+912026901306(O) direct 
+912026982424 Extn:1306

-
Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls.  Great rates 
starting at 1cent;/min.

Re: Is tile definations Instance is singleton

2006-05-23 Thread Antonio Petrelli

navin mca ha scritto:

Hi Antonio,
   
  Oh boy your English gave me an headache!


  I am really sorry for my bad english.
   
  Following is my tile definition.
   
  definition name=forwardDynamicTile path=/WEB-INF/testLayOut.jsp
  put name=attribute1 value=attribute1Value type=string/ 
  putList name=body
  add value=/WEB-INF/position1.jsp / 
  !--Conditional Include-- 
  
  add value=/WEB-INF/position3.jsp /
  !--Conditional Include-- 
  add value=/WEB-INF/position4.jsp / 
  add value=/WEB-INF/position5.jsp / 
  /putList 
   


Uh sorry, I forgot an important thing. Maybe instead of using Tiles 
definitions, you can use the tiles:insert with tiles:put tags, as 
explained in:

http://www.lifl.fr/~dumoulin/tiles/doc/tutorial.html#_Toc521292375
I did not try but if you use JSTL's c:if tag with tiles:add maybe it 
will work.

Ciao
Antonio

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



Re: Is tile definations Instance is singleton

2006-05-23 Thread Antonio Petrelli

navin mca ha scritto:

Hi Antonio ,
   
   plug-in className=org.apache.struts.tiles.TilesPlugin
set-property property=definitions-config 
value=/WEB-INF/dimensions-config.xml/
  


WHOOPS!! I am sorry wrong cun'n'paste:

 plug-in className=org.apache.struts.tiles.TilesPlugin
   set-property property=definitions-factory-class 
value=my.package.FactorySetSubClass/

 /plug-in

   
  1. wht should I put in dimensions-config.xml file (Do you want to say that I should put my tile definition in it which is having such complex accessing problem.)
  


Err... sorry again, ignore it :-P
   
  2. wht should I do to implement DefinitionsFactory or extend FactorySet , I had read the documentation but there is no much help regarding these classes.
  


In fact you are right, there is no tutorial or such, only Javadocs:
http://struts.apache.org/struts-action/struts-tiles/apidocs/org/apache/struts/tiles/xmlDefinition/DefinitionsFactory.html
http://struts.apache.org/struts-action/struts-tiles/apidocs/org/apache/struts/tiles/xmlDefinition/FactorySet.html


  Do u want to say that after making above configuration in the struts config 
file FactorySet will be automatically implemented by struts and one request 
will be served by one exclusive instance of the same tile definition file.
  


It depends on your implementation. Anyway I think the solution I wrote 
in the last e-mail is better for you (the one with JSP Tiles custom tags).
   
  if not then let me explain or direct me to some example or tutorial.
  


There is probably no example of using the multi-channel support of 
Tiles, maybe only Dimensions tried to use it.


HTH
Ciao
Antonio

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



Re: Is tile definations Instance is singleton

2006-05-23 Thread navin mca
Hi Antonio,
   
  Thanks alot for your support to the community, I really appreciate it.
   
  It depends on your implementation. Anyway I think the solution I wrote 
in the last e-mail is better for you (the one with JSP Tiles custom tags).
 

  Even wht u have suugested, I had already thought to implement it first by 
creating two diffrent definition file to cater this problem with some layout 
page which will handle the condition.
   
  Thanks once gain 
  regards,
  Novin
   
  

Antonio Petrelli [EMAIL PROTECTED] wrote:
  navin mca ha scritto:
 Hi Antonio ,
 
 

  value=/WEB-INF/dimensions-config.xml/
 

WHOOPS!! I am sorry wrong cun'n'paste:



value=my.package.FactorySetSubClass/



 
 1. wht should I put in dimensions-config.xml file (Do you want to say that I 
 should put my tile definition in it which is having such complex accessing 
 problem.)
 

Err... sorry again, ignore it :-P
 
 2. wht should I do to implement DefinitionsFactory or extend FactorySet , I 
 had read the documentation but there is no much help regarding these classes.
 

In fact you are right, there is no tutorial or such, only Javadocs:
http://struts.apache.org/struts-action/struts-tiles/apidocs/org/apache/struts/tiles/xmlDefinition/DefinitionsFactory.html
http://struts.apache.org/struts-action/struts-tiles/apidocs/org/apache/struts/tiles/xmlDefinition/FactorySet.html

 Do u want to say that after making above configuration in the struts config 
 file FactorySet will be automatically implemented by struts and one request 
 will be served by one exclusive instance of the same tile definition file.
 

It depends on your implementation. Anyway I think the solution I wrote 
in the last e-mail is better for you (the one with JSP Tiles custom tags).
 
 if not then let me explain or direct me to some example or tutorial.
 

There is probably no example of using the multi-channel support of 
Tiles, maybe only Dimensions tried to use it.

HTH
Ciao
Antonio

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




Thanks and Regards, 
Novin Jaiswal 
+919890089443(M) 
+912039511388(H) 
+912026901306(O) direct 
+912026982424 Extn:1306

-
Sneak preview the  all-new Yahoo.com. It's not radically different. Just 
radically better. 

Is tile definations Instance is singleton

2006-05-22 Thread navin mca
Hi,
   
  I my project at run time when modify the tile definition based on some 
condition.
   
  Wht I want to know that when symultaneous request come for that tile (which 
will be used in rendering the page for that request.) Unexpected results for 
diff user.
   
   
  for e.g
   
  one userwithoutBody the from the tile definition we will remove the attribute 
'body' and for the userwithBody 's request we will add attribute 'body' in the 
definition at run time.
   
  In the above scenerio is it possible that tile definition(where attribute 
'body' is removed for userwithoutBody ) can be sent back to userwithBody  due 
to multiple request coming for userwithoutBody  userwithoutBody.
   
  the above code is my action handler.
   
  Basically this qn. bvelongs to multithreading.
   
  Do i need to use synchonised block?
   
  Pls let me know.
   
  regards,
  Novin.
   
   
   
   


-
Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls.  Great rates 
starting at 1cent;/min.

Re: Is tile definations Instance is singleton

2006-05-22 Thread Antonio Petrelli

navin mca ha scritto:

Hi,
   
  I my project at run time when modify the tile definition based on some condition.
   
  Wht I want to know that when symultaneous request come for that tile (which will be used in rendering the page for that request.) Unexpected results for diff user.
   
   
  for e.g
   
  one userwithoutBody the from the tile definition we will remove the attribute 'body' and for the userwithBody 's request we will add attribute 'body' in the definition at run time.
   
  In the above scenerio is it possible that tile definition(where attribute 'body' is removed for userwithoutBody ) can be sent back to userwithBody  due to multiple request coming for userwithoutBody  userwithoutBody.
   
  the above code is my action handler.
   
  Basically this qn. bvelongs to multithreading.
   
  Do i need to use synchonised block?
   
  Pls let me know.
   


Oh boy your English gave me an headache!
Anyway are you trying to modify Tiles definitions at runtime? If so, 
remember that you change it for EVERY user, at least if you are trying 
to use the default DefinitionsFactory.
If you want to give different Tiles definitions for different users 
(this is something like MyYahoo and similar) consider implementing 
DefinitionsFactory or FactorySet (that is better).
If you only need different tiles definitions with different user ROLES, 
then consider downloading Dimensions:

http//mutidimensions.sf.net/
HTH
Antonio

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



Re: Is tile definations Instance is singleton

2006-05-22 Thread navin mca
Hi Antonio,
   
  Oh boy your English gave me an headache!

  I am really sorry for my bad english.
   
  Following is my tile definition.
   
  definition name=forwardDynamicTile path=/WEB-INF/testLayOut.jsp
  put name=attribute1 value=attribute1Value type=string/ 
  putList name=body
  add value=/WEB-INF/position1.jsp / 
  !--Conditional Include-- 
  
  add value=/WEB-INF/position3.jsp /
  !--Conditional Include-- 
  add value=/WEB-INF/position4.jsp / 
  add value=/WEB-INF/position5.jsp / 
  /putList 
   
  Here 
   
  add value=/WEB-INF/position3.jsp /
   
  is the condional tile which will be added/removed at run time from the tile 
definition object based on some request flag.
   
  So my query is 
   
  What will happen when there will be multiple calls for the same Tile 
definition for both form of the tile object(with or without position3.jsp tile)
   
  Means for multiple user request , bcas the struts manages only a single 
object of the tile definition with the same single attribute hashmap as a 
member var. of the definiton object.
   
  This will lead to problem when simultaneous multiple user request will come.
   
  I had checked the references of that hashmap for multiple request while 
storing that map in servletcontext and using two different browser/session. 
   
  The reference of hashmap of attributes /tile definition remain same.
   
  PLs let me know ur commnets on this.
  
regards,
  Novin


Antonio Petrelli [EMAIL PROTECTED] wrote:
  navin mca ha scritto:
 Hi,
 
 I my project at run time when modify the tile definition based on some 
 condition.
 
 Wht I want to know that when symultaneous request come for that tile (which 
 will be used in rendering the page for that request.) Unexpected results for 
 diff user.
 
 
 for e.g
 
 one userwithoutBody the from the tile definition we will remove the attribute 
 'body' and for the userwithBody 's request we will add attribute 'body' in 
 the definition at run time.
 
 In the above scenerio is it possible that tile definition(where attribute 
 'body' is removed for userwithoutBody ) can be sent back to userwithBody due 
 to multiple request coming for userwithoutBody  userwithoutBody.
 
 the above code is my action handler.
 
 Basically this qn. bvelongs to multithreading.
 
 Do i need to use synchonised block?
 
 Pls let me know.
 

Oh boy your English gave me an headache!
Anyway are you trying to modify Tiles definitions at runtime? If so, 
remember that you change it for EVERY user, at least if you are trying 
to use the default DefinitionsFactory.
If you want to give different Tiles definitions for different users 
(this is something like MyYahoo and similar) consider implementing 
DefinitionsFactory or FactorySet (that is better).
If you only need different tiles definitions with different user ROLES, 
then consider downloading Dimensions:
http//mutidimensions.sf.net/
HTH
Antonio

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




Thanks and Regards, 
Novin Jaiswal 
+919890089443(M) 
+912039511388(H) 
+912026901306(O) direct 
+912026982424 Extn:1306

-
Be a chatter box. Enjoy free PC-to-PC calls  with Yahoo! Messenger with Voice.