Spring, Jsp , goto variable - spring

Today I was just coding some Jspx page using Spring framework and an error appared that I didn't understand because I had just copy past the same several time and it was working perfectly with just the original line. It seems that the following lines were unusable :
<spring:url var="goto" value="/resources/images/goto16.png" />
<img alt="goto" src="${goto}"/>
But if I change the name "goto" to anything else, "got" for instance, then it woks fine !
I guess that this word is protected because used for another purpose, but I didn't find a clue about this problem on the net.
Does anyone know something about this matter ? I don't really need "goto" but I would like to know why I can't use it.
Thanks

goto is a reserved word in Java, and as JSP's are translated into Java source code the variable name will appear somewhere in that code, causing the compilation issue.

Related

Using of Sitecore's XPath builder to test queries

i'm getting started with sitecore and i just discovered this tool sitecore offers to test our queries:
My problem is i just can't make it return results and i do know this query works perfectly cause i've been using it on my project right now.
There is probably a problem of syntax somwhere i don't know.
Thank you for helping me to put some light on this !
It's a bit difficult to tell due to how bits of that are redacted (there might be other syntax errors hiding under the boxes), but there's one obvious issue there, I think: You don't need the "query:" bit on the beginning of what you've typed.
In general, if the API or web form your filling in can only take a query expression you can leave the "query:" bit off. But if you're putting text into somewhere that might take a query or might take something else then "query:" is needed to tell Sitecore what it's looking at.

Magento code changes in local don't work

I'm trying to fix the Magento search issue where 'OR' is used for comparison of multiple search terms instead of 'AND'.
I've seen quite a number of suggestions on the web regarding how to fix this, and the general idea is as follows:
Copy
app/code/core/Mage/CatalogSearch/Model/resource/Fulltext.php to
app/code/local/Mage/CatalogSearch/Model/resource/Fulltext.php and in the copy, change the instances of 'OR' to 'AND', where the SQL queries are built.
However, my changes don't seem to work as expected and what is even more confusing is that the prepareResult() method (which is where the SQL changes above are made) doesn't even seem to run at all when searches are done. I've tested this by putting some debugging code in the function.
I've used the same debug code to verify that the file gets loaded. But the debug code doesn't run when inserted at the prepareResult() function. (The debug code basically writes to a file on disk).
What am I missing here?
Kindly note that this is not so much about the right way to accomplish the end goal of fixing Magento search. I'm aware it's best done via an extension. I'd just like to figure out why prepareResult() isn't being called as expected.

Rainmeter: How to concatenate strings

I am getting data from a broken RSS feed that gives me wrong link. I wanted to fix this link so I made this code:
<link.*>(.*)&.*tid(.*)</link>
and the link could be like:
www.somedomain.com/?value=50&burrrdurrrr;tid=120
But the real working link is in this form:
www.somedomain.com/?value=50&tid=120
The thing that I'm asking is if my measure thing looks like this:
[FeedURL]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Feed]
StringIndex=2 ;now I only get www.somedomain.com/?value=50
Substitute=#SubstituteFeed#
How am I supposed to concatenate the strings together to complete the url?
I'm guessing rather than &burrrdurrrr;, the link has &, which is how you have to write & in an HTML or XML file.
If that's the case, you just need to set the DecodeCharacterReference option, as described in this handy-looking tutorial. Another option mentioned there is Substitute, which would be able to strip it out even if it really was &burrrdurrrr;.
None of this is a particularly sensible way of dealing with HTML or XML - a much better approach would be a plugin which actually parsed the document structure and let you reference nodes using XPath or CSS rules - but you work with what you've got, I guess. (I've never heard of this "Rainmeter" before, despite its claim to be "the best known and most popular desktop customization program for Windows"; maybe because nobody else calls their program that, instead almost universally using the word "widget"?)

Script not working only in Firefox

I have a script that basically is a search/filter that runs all browsers except firefox. And I dont know what is wrong. I'm trying since saturday find what is wrong, searching here if someone had the same problem and nothing. I'm LEARNING javascript, so I'm hoping someone can point me into the right direction to find what i'm not doing right or what i'm missing. Any help will be appreciated.
http://jsfiddle.net/ccarizzo/GYcbE/
online here
The problem, as you can tell by looking in the error console, is this code:
$(listaProdutos).find('a:Contains(' + filter + ')').parent();
There is no "listaProdutos" variable in the script. You're relying on a non-standard behavior in other browsers that reflects all IDs into the global scope.
This should work:
$("listaProdutos").find('a:Contains(' + filter + ')').parent();
You need a similar change in some other places too.
Use the W3C validator to check interoperability of your web-scripts.
Click here to get yours validated.

Magento translation fails

I have trouble translating the phrase "%s was added to your shopping cart." in magento. This is a message that is called in a php-controller (cartController.php).
I use csv-files for the translation and checked them multiple times for errors (missing quotes, wrong quotes, ...), but the translation still won't work. Translating inline seems also impossible as no option is shown to translate success-messages.
I also checked the store language (which is set to Dutch), locale configuration and via code what language he finds, this all turns out fine, everything is okay.
Does anyone know what next steps I should take to investigate this problem or even better: does anyone know a solution for this problem? I found many threads like this one, but unanswered or without an answer for me.
One more thing: Yes, I cleared my cache and translations ;-).
Tx
Try to put translate.csv into your theme folder:
(root)/app/design/frontend/(theme)/default/locale/nl_NL/translate.csv
And put your translation there.
Check the encoding of your file Mage_Checkout.csv
Probably you have ANSI or UTF-8, but it should be "UTF-8 without BOM", otherwise Magento has troubles in using the translation file.

Resources