how to use multiple viewresolvers of the same type in Spring? - spring

enter image description here
I have used 2 viewresolver InternalResourceViewResolver as shown above, but when req, file not found error as shown below
enter image description here
My controler handle req:
enter image description here
Can anyone help me, thanks a lot !
i tried set order but still not working

Related

Vote for comments in posts function with Codeigniter and routing

I am trying to create posts with comments with CodeIgniter and I am trying to add voting for the comments with + and -.
But my problem is not actually this functionallity but more exactly creating the link and the method in controller/model for this.
I understand that there is some kind of link to methods.
If I have something like this:
public function like() {
echo 'Test Function';
}
and when I create link like this one sitename.com/posts/first-post/like theoritecally I will see blank page with "Test Function" text (and of course if I write proper routing rule but I cannor for now).
I can see a blank page with this working echo 'Test Function', but does this mean I have to load every methods and views for the entire page if I want to display the entire webpage with all the elements? I think that I mistake something very serious here but I don't know what.
The example with the "Create news" tutorial in ellislab.com didnt help me. They show something similar I think with /create/ section in the URL and create() methods.
If I have many links with functionallities do I have to add new routing rules for all of them? I really tried to search in Google and everywhere but I didnt find anything related.
Sorry for this lame question.
You need to use Ajax call and on callback you have to increase or decrease the count. For creating a link , once page is loading render the data and provided the default link like
for + http://<site.com>/<controller>/like?totalLike=<36>
for - http://<site.com>/<controller>/unlike?totalunLike=<3>
Once user will click + link then by using Ajax, call the controller method link/unlike and increase or decrease the count and repopulate the link again with fresh counter.
Hope it will resolve your problem.

pass input type image name/value as a parameter to Action Method in MVC 3

I have an image in a view
<input type="image" src="(Location)" name="next" id="imgNext"/>
Now what I need to do is to pass the name of the image ("Next") to the action method in the controller, when a user clicks the image...which causes a Post request to the action method.
public ViewResult Process(string next)
{
}
The above code is working fine in Chrome, but not in IE8/9. Can anyone help me out with this issue?
edit:
I am wondering if this could be a common issue in MVC 3...I would love to know how one could possibly get around by using an image as I need to use the image.
Any help will be deeply apprecited...
It also won't work in Firefox. This is because image inputs do not submit the name as standard behavior. They only submit the x and y coordinates of the pixel clicked on the image.
You would do better to use a <button> element that contains an <img> tag.
I assume you have several buttons on your form and you want to know which button was clicked. There are several good solutions for this. For example:
http://weblogs.asp.net/dfindley/archive/2009/05/31/asp-net-mvc-multiple-buttons-in-the-same-form.aspx

Embedded font from dynamically loaded swf not recognised

I am working on an application which needs to load fonts dynamically based upon the fonts used in a given document that the user opens. The fonts are used in a RichEditableTextControl so need to be CFF format.
If I add the code:
[Embed(source="/assets/fonts/AvenirLTStd Book.otf",
fontFamily="EmbedAvenir LT Std 45 Book",
mimeType="application/x-font",
embedAsCFF="true")]
public const embeddedFont:Class;
to the main SWF then the text displays correctly with the embedded font but moving the code to a separate file and adding a loader as per the information I found at the following link does not load the font - http://www.scottgmorgan.com/blog/index.php/2007/06/18/runtime-font-embedding-in-as3-there-is-no-need-to-embed-the-entire-fontset-anymore/
The loader code is:
private function loadFont(url:String):void {
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, fontLoaded);
loader.load(new URLRequest(url));
}
private function fontLoaded(event:Event):void {
var FontLibrary:Class = event.target.applicationDomain.getDefinition("FontAvenirLTStd") as Class;
Font.registerFont(FontLibrary.embeddedFont);
}
There is an error thrown at the Font.registerFont line to say that the parameter being passed cannot be null. I have checked in debug mode and the issue seems to be that the class exists but does not have any content. The FontLibrary class is instantiated but the only child entry in the debugger is _prototype so trying to access the embeddedFont property does return undefined.
At the moment the font SWF is in the assets folder of the main project so I don't believe there should be any security restrictions and, as I said, the SWF loading part appears to work.
One thing which is hampering my diagnostics is that I am not sure if the problem is the font SWF not being created correctly and having no content or if the main app is unable to load it. Any help on at least being able to narrow that down would be appreciated.
I would appreciate all the help I can get on this as I have been stuck at this problem for some time and it is a key part of the application.
Thanks in advance to everyone.
Just a quick note for anyone who ends up here from Google, the problem was that I had managed to lose the static keyword from the embeddedFont constant definition in the top block. It should have been public static const embeddedFont:Class;
Hope this helps someone.

Vaadin how to change default validation functionality

I am using vaadin in a portlet environment where we have specific validation look & feel and behavior.
When input fields have invalid values,
their borders color becomes red.
All the error messages (as link) are shown above or below at common location.
Clicking on specific error results into cursor focus going to related field.
So how can i achieve this functionality and what i need to change & modify.
For your point #1, You need to create a theme. To do that, I suggest you to read the Book of Vaadin chapter 5 and 8.
Chapter 5 explain the ui component and css style associated with them.
Chapter 8 explain how to inherits a css theme.
For point #2, You have to add a layout to your page, and for each message youy will create a button and style it like a web link.
Button button = new Button("Your error message");
button.setStyle(BaseTheme.BUTTON_LINK);
errorLayout.addComponent(button);
For point #3, add listener to your button link, and when clicked, focus the component in error. So the previous code will now look like this
Button button = new Button("Your error message");
button.setStyle(BaseTheme.BUTTON_LINK);
button.addListener(new Button.ClickListener(){
public void buttonClick(ClickEvent event){
// Replace componentInError by the associated component of the link.
componentInError.focus();
}
}
errorLayout.addComponent(button);
Regards.
Éric

magento validation related problem

can any one tell me where or in which file(path of that file I need to make change for edit validation class like input-text required-entry in magneto..
I required this because->
this validation is not working if there is default value in text box where this class is applied..
like .. in my form name filed name has two text box in which default value is first and last respectively .. so the main problem is arise when user does not enter any text in these fields...and do submit and the validation class is get failed because its not any showing error message
Thanks for any help or suggestion
Richa
You'll find that file at /js/prototype/validation.js note this is under the main root of the install, not in the skin js folders.

Resources