KonaKart Community Forum

Installation / Configuration => Programming of KonaKart => Topic started by: bibi on October 19, 2012, 01:07:49 pm

Title: SetMsgValue() on server engine instance
Post by: bibi on October 19, 2012, 01:07:49 pm
Hi,

Is it possible to call getMsgValue() from a client side instance?

<bean:define id="kkEng" name="konakartKey" type="com.konakart.al.KKAppEng"/>

<head>
<% kkEng.setPageTitle(kkEng.getEng().getMsgValue("message.example", 1, "us_US"));%><title ><bean:message key="<%=kkEng.getPageTitle()%>"/></title>
</head>

Errors log says that : getMsgValue function is not defined with KKEngIf

Thanks

Title: Re: SetMsgValue() on server engine instance
Post by: julie on October 29, 2012, 08:13:47 pm
I don't understand what you're trying to achieve. Looks like you're trying to call a method on KKEng (which implements KKEngIf) that doesn't exist.
Title: Re: SetMsgValue() on server engine instance
Post by: bibi on October 31, 2012, 01:27:40 am
Hi,

I am trying to find any easy way to implement Unique Title and meta description for each page( for SEO ) of a website?

By the way,  can you help???
:-[


Thanks
Title: Re: SetMsgValue() on server engine instance
Post by: julie on October 31, 2012, 03:42:14 pm
Can't you just set it in the struts action class that is called before the page is displayed?
Title: Re: SetMsgValue() on server engine instance
Post by: bibi on October 31, 2012, 04:32:03 pm
I thought there was way to do it on the server without recompiling, any way thx

Title: Re: SetMsgValue() on server engine instance
Post by: bibi on November 05, 2012, 04:22:50 pm
Hi

I've found a way to do it without much effort, i didnt take time to test all the pages (if problems i will update the post) i would like to share it with you all

1 Change the getKKAppEng() function of the BaseAction.java
2 Modify de setPageTitle(), setMetaDescription(), setMetaKeywords() functions with the following
        kkAppEng.setPageTitle(getCatMessage(request, kkAppEng.getPageTitle()));
        kkAppEng.setMetaDescription(getCatMessage(request, kkAppEng.getMetaDescription()));
        kkAppEng.setMetaKeywords(getCatMessage(request, kkAppEng.getMetaKeywords()));
3 Recompile

4 Adding on the current JSP the following portion of code
will do the job
       <% kkEng.setPageTitle("my.titleforthecurrentjsp");%>
my.titleforthecurrentjsp is the index key of the message catalog u want to set


I didnt check yet the meta keywords, but i will update if any problem detected

It take some time for the generated class to stabilize for the accurate  title, but it work fine now



PS: problem may arise on the performance side, i will check that too

Best regards