Featured post
java - Converting to JSTL (Specificlly on calling methods) -
i'm in process of going full jstl way, , i've got issue following scriplet, have transformed variable displaying , conditions expression language (el) i'm not sure of how method calling : here's jsp code positioned before html markup: userdto user = (userdto) session.getattribute("user");
orderdao lnkorder = new orderdao(); orderdto order = new orderdto(); coverdao lnkcover = new coverdao(); coverdto cover = new coverdto(); upgradesdao lnkupgrades = new upgradesdao(); upgradesdto upgrades = new upgradesdto(); orderaccessoriedao lnkorderacc = new orderaccessoriedao(); list<orderaccessoriedto> orderaccessories = new arraylist<orderaccessoriedto>(); groupcolorsdao lnkcolors = new groupcolorsdao(); list<colordto> colorlist = new arraylist<colordto>(); colorlist = lnkcolors.getgroupcolors(user.getgroup()); accessorydao lnkacc = new accessorydao(); list<accessorydto> groupaccessories = new arraylist<accessorydto>(); groupaccessories = lnkacc.getgroupaccessories(user.getgroup()); changesdao lnkchanges = new changesdao(); list<changedto> orderchanges = new arraylist<changedto>(); string currentorder = request.getparameter("currentorder"); if (lnkorder.exists(currentorder)) { order = lnkorder.find(currentorder); cover = lnkcover.find(order.getreferencenumber()); upgrades = lnkupgrades.find(order.getreferencenumber()); orderaccessories = lnkorderacc.getorderaccessories(order.getreferencenumber()); orderchanges = lnkchanges.getorderchanges(order.getreferencenumber()); }
yo can see it's pretty dao , dto objects, know can done using static methods , making custom taglibs mean writing code each method call, other approach?, suggestions accepted. brief description of view
(html markup) displays details of given order, order name extracted get
request.
also have small question, suppose port jstl, have import corresponding mydto
, mydao
packages access getters , setters each dto?
regards tristian.
"jstl way" doesn't make sense without full separation between view , logic, in model 2 approach.
in model 2 approach move code servlet acts controller jstl page, , use jsp view markup. otherwise using jstl enforce separation between logic , view jstl meaningless.
- Get link
- X
- Other Apps
Comments
Post a Comment