I'm new to the Struts 2 world. I just figured out how to use the Convention plugin and I must say it's quite nice.
However, all of my JSP files of course have the complete head, title, etc. I want to build a reusable template and plug in various views (much like how Rails does it with the application.html.erb)
I got Tiles to work on a Struts 1 site before and it was a total nightmare. In my Struts 2 app, I am using the convention pattern so I have had almost no XML and would like to keep it that way.
Is there an easier way to do this other than Tiles?
Thanks.
Yes. Use the JSP 2.0 tag file feature. My answer to a previous, similar question may be of some use to you.
JSP, can it work similar to yield, layout, content_for in Ruby/Rails/Erb
Related
Im looking to make the editor templates in my MVC application use HTML5 input types. The framework seems to get about 80% of the way there but there are a couple of things I can't seem to make happen (step values on numerics, placeholders, URL inputs, etc).
I'm sure that quite a bit of this is just me not knowing where to look, but
Is there a definitive list of what attributes I can use on View Models to provide the metadata used to generate the html?
Does anyone know of a project / nuget package that helps with this? I'm not opposed to writing something, but would rather use something that's already been tried and tested. Dean Hume's ASP.net MVC HTML5 Helpers Toolkit is close, but I'd like to put as much information in the attributes as possible and let the runtime do the work via Html.EditorFor (just a personal preference).
Thanks,
Joe
Check this out : http://weblogs.asp.net/rashid/archive/2010/10/21/integrate-html5-form-in-asp-net-mvc.aspx
See if it can help you get started.
I am going to develope a web application. Which framework(struts1 or struts2) should i choose?
Which one is easier to understand and code.
Is applying CSS/HTML in struts2 difficult?
I have used Struts1 and Struts 2 extensively. Struts2 is far better than Struts 1. Struts 2 is the way forward. There are a whole lots of improvements in Struts 2.
The use of interceptors.
Pojo like actions
No action forms.
Easy integration with other frameworks like spring, dwt etc
[I deleted the part about this being a too generic question, as I misread the initial question, sorry...]
Use struts2 since they obviously learned from what was flawed in Struts1. They introduced interfaces so that you can extend your own classes and use Dynaforms for form data binding (in struts 1 you have to write such a FormBean for every f*** form in your app). If you use struts you should also use tiles.
Another framework that is definitely worth a look is Wicket. So far so good. Good luck!
I think struts2 is better .Please read the below article
http://www.java-samples.com/showtutorial.php?tutorialid=200
Use struts 2 and you can also integrate it with spring.
Does anyone have any experience creating a skin engine for asp.net MVC? I know the suggested approach is to use flexible markup with CSS, but I would like the ability for a new view to be dropped in, and the application use that one instead of the default one.
Basically, I want to know how to tell the framework (at run time) to look into a specific folder for the views/content, and if the item isn't there to check the default locations.
I started to look into how the Oxite blog engine does it, but it seems like that might be a bit much for what I need (I am still looking through it, so I could be wrong.) Any help is appreciated.
You need to change the ViewEngine a little bit.
See this post http://bartreyserhove.blogspot.com/2009/02/building-multi-tenant-applications-with_22.html
It can be done for partials and masterpage also.
One of the things I liked about freemarker is that you can quickly create new macros that encapsulate complex html to make the pages smaller and more concise. Do I have to make tag libraries to do the same thing in grails, or is there a really light-weight syntax for achieving the same thing?
There is a <g:render> tag, which may match your needs. It's documented here.
I'm interested in seeing what custom extensions other developers have created for the ASP.NET MVC HtmlHelper class.
I think Microsoft got off to a great a start, but as usual, left a lot of open holes to fill!
Looks like I am going to have to create some for rendering images, rendering action links as images, and so on.
Thought it might be beneficial to actually put a list together and save some other developers some time and effort, and I'll be honest, save me some time as well. =)
If you have any website links to other extension methods for the HtmlHelper class please provide them!
You should check the MVC-Contrib project on Codeplex...
Also, I just found this paging extension to the HtmlHelper which looks pretty cool, although I've not used it yet.
I wrote an article about building custom controls in ASP.NET MVC, and I actually use the "Rollup Grid View" that I built in there.
I wrote a post to gather useful MVC HtmlHelpers and share them with others; we can grow it up!
Take a look: http://sharplife.net/2008/11/14/UsefulHtmlHelpersForASPNETMVC.aspx (or http://tinyurl.com/mvchelper to remember easily!).
I made quite a few for a project I did at work. The ones that I can think off the top of my head were:
ActionImage, which was the unholy love child of ActionLink and Image.
ScriptBlock, which could write out a JavaScript script block based on some parameters from the ASP.NET.
Textile, which would take a string marked up in Textile markup and write out that markup as XHTML produced by a Textile library.
There were a few other more specific ones as well, but I think it's a really neat way of encapsulating blocks of tags.