Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

java - Using and controlling Spring transactions within Struts 2 actions -


hey guys, have been working while on project following components:

  • struts2.1.8.1,
  • spring 3.0.3
  • jpa 2.0,
  • hibernate 3

i using spring's entitymanager magic... i'm having problems dealing transactions inside actions. instance, setting values on persisted object in several methods within class, , want able rollback if validate method finds validation error, or commit these changes otherwise. have spent quite long time reading half of internet comprehensive explanation. unfortunately, no complete examples exist (at least similar stack).

i have stumbled thread on mailing list: @transactional spring annotation in struts2 action not work. message i'm linking @ seems have pretty simple , straightforward solution, using transactioninterceptor trick seems... problem i'm not finding useful information regarding interceptor.

anyone here has experience technology , can spare tip , link or 2 on how use spring transactions inside struts2 actions?

thanks!

- edit 1 -

i have set test project if interested, download file , try out (or inspect it). thanks!

generally, controllers/actions/backing beans/etc don't handle transactions. actions web-part of back-end code - should concerned gathering request data, , sending response data. logic (including database access) should done in layer. e.g. service layer. create bean, inject in action, , make work - userservice.register(user). configuring transactions on service layer should trivial since both in spring documentation , in countless examples:

<tx:annotation-driven /> , @transactional (btw, make sure have <tx:..> now, might causing issue. if works, not invalidate suggestion service layer)


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -