开发者

What is ideal place to keep file download code?

I have a struts1 application. It supports download-to-excel. I开发者_运维知识库 have Dao layer which gives me data. I have service layer and then actions (model).

Where should i keep file creation code..? in action or service ? or shd i have util (util creates really bad code)


To kickstart the download of the excel file, creating an action that Struts can kick from but let the service call the DAO and retrieve the file data and return the file data back to the action.

That way, if you change MVC or need to add other SOA, like RESTful or WS, then the service will always return the file data.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜