• Welcome to KonaKart Community Forum. Please login or sign up.
April 15, 2024, 01:45:29 am

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - rula

Programming of KonaKart / Re: exception handling
July 31, 2008, 05:24:04 pm
Hi pete,
With those three changes to the action classes isn't the problem fixed ? All messages are now taken from the message catalog. They were taken from the message catalog even before the fix but were cached and so not changed if you decided to change the language of your UI.

1.extended PropertyMessageResources.java
2.extended PropertyMessageResourcesFactory.java
3.call reload methode in SetLocaleAction.java
4.replaced <message-resources/> tag


public class ReloadablePropertyMessageResources
extends PropertyMessageResources{

public ReloadablePropertyMessageResources(ReloadablePropertyMessageResourcesFactory factory, String config){
super(factory, config);

public ReloadablePropertyMessageResources(ReloadablePropertyMessageResourcesFactory factory, String config, boolean returnNull){
super(factory, config, returnNull);

public synchronized void reload(){


public class ReloadablePropertyMessageResourcesFactory
extends PropertyMessageResourcesFactory{

public MessageResources createResources(String config){
return new ReloadablePropertyMessageResources(this, config, this.getReturnNull());




  <message-resources parameter="Messages" null="false"/>
  <message-resources parameter="Messages" com.konakart.ReloadablePropertyMessageResourcesFactory"/>

It seems to work, but I am not sure.
The clearing of the resources hashmaps in the reload methode seems to solve the caching problem.
Is this okay!?

regards, rula
Programming of KonaKart / Re: exception handling
July 30, 2008, 07:27:08 pm
Hi pete,

okay, this with the exception was only a idea a my code is indeed not so secure. :o
regards, rula
Programming of KonaKart / Re: exception handling
July 30, 2008, 06:58:47 pm
Hi pete,
I saw something like this and tested it.

in struts-config:
<action path="/login"
  <exception  type="de.rula.dga.UnknownUserException"
  <exception  type="de.rula.dga.InvalidPasswordException"
  <forward name="success" path="home"/>

in UserService:
public User authenticate(String userName, String password)
throws Exception{
  User user = userDao.getUser(userName);
  if(user == null){
    throw new UnknownUserException();
  boolean validPassword = user.passwordMatch(password);
    throw new InvalidPasswordException();
  List roles = userDao.getRoles(userName);

  return user;

in UserAction:
public ActionForward login( ActionMapping mapping,
                            ActionForm form,
                            HttpServletRequest request,
                            HttpServletResponse response)
  throws Exception{
  HttpSession session = request.getSession();
  DynaValidatorActionForm userForm = (DynaValidatorActionForm)form;
  User user = (User)FormUtils.getFormValues(userForm, this, mapping, request); 
  user = userService.authenticate(user.getUsername(), user.getPassword());
  session.setAttribute("user", user);
  return mapping.findForward(Const.FORWARD_SUCCESS);

I mean, I have not to handle the exceptions in the actions, but configure it in struts(-config).

I am only a small struts user and no developer and don't understand the details of caching message resources. regards, rula
Programming of KonaKart / Re: exception handling
July 30, 2008, 06:08:57 pm
Hi pete,

I do something like this:

return getForward(mapping, request, e, "com.konakart.app.KKUserExistsException",
                  Constants.userExists, "ApplicationError");
String message = getResources(request).getMessage(getLocale(request), "register.customer.body.user.exists");
return getForward(mapping, request, e, "com.konakart.app.KKUserExistsException",
                  message, "ApplicationError");

NewAddrSubmitAction.java and

I have looked for all ApplicationErrorrs that I have found in Custom Actions.

Struts declarativ exception handling over struts-config could be nice for me.
Is it possible and good to catch the ApplicationErrors over global or local exception tags and remove try catch blocks?

i18n is not so easy in konakart, many property files are not enough.

regards, rula

Programming of KonaKart / Re: exception handling
July 30, 2008, 03:09:50 pm
Hi pete,

I would call the getForward methode with my translated message text instead of 'Constants.invalidZone'  for this exception.
Is this the way to reach a locale sensitive message when this exception occurs? 

return getForward(mapping, request, e, "com.konakart.app.KKInvalidZoneException",
Constants.invalidZone, "ApplicationError");

regards, rula
Programming of KonaKart / exception handling
July 30, 2008, 01:39:09 pm
Hi Konakarts,
I don't understand the complete exception handling of konakart, but I estimate that it is very good.
NowI have a i18n problem with exceptions and messages (errors).
I need a message-key but a message text (in the false language) is delivered.

in NewAddrSubmitAction.java:

}catch (KKException e1)
  return mapping.findForward(super.handleException(request, e1));
  return getForward(mapping, request, e, "com.konakart.app.KKInvalidZoneException",
  Constants.invalidZone, "ApplicationError");

delivered in NewAddrBody.jsp:

Please select a state from the States pull down menu.

and in requestScope:

org.apache.struts.action.ERROR  {org.apache.struts.action.GLOBAL_MESSAGE=[exception.null.message[Please select a state from the States pull down menu.]]} 

How can I get a usable errorKey form this exception for translation in the jsp. (<html:messages...) ?

regards, rula
Programming of KonaKart / Re: Shipping
July 30, 2008, 09:45:24 am
Hi pete,

thank you very much for your super answers and your good tips.
In the future I have to look better in the faq's and first of all in the java api doc.
Here and in the code of the modules I will find most of the answers of my questions, but not all.

regards, rula
Programming of KonaKart / Re: Shipping
July 30, 2008, 06:13:42 am
Hi pete,
oh sorry pete, I don't have accociated the order products with the product type 'pysical free shipping'.
Thanks for your help. The product type of the order products is the key for the available shipping (or perhaps payment too) modules.
By the way, can I configure own product types in konakart?

regards, rula
Programming of KonaKart / Re: Shipping
July 29, 2008, 09:01:28 pm
Hi pete,
sure, I have installed the free shopping module, but it appears not in the list of the jsp. The array is empty, if I only install this module. The other delivery modules are avialable after installation.

regards, rula
Programming of KonaKart / Re: Shipping
July 29, 2008, 04:59:29 pm
Hi Konakarts,

I miss the free shipping entry in CatalogCheckoutDeliveryBody.jsp.
orderMgr.getShippingQuotes().length = 0 if I have selected the free shipping module in the admin app.

In the past, I say a entry for free shipping to select in the pages for the checkout process.

Exists such an entry and where is it now.

regards, rula
Configuration of KonaKart / Re: URL Problem
July 18, 2008, 06:43:32 pm
Hi nickgk,

categories-tile-1 not rendered correctly

Search Exceptions

View catMgr and catList beans in CategoriesTile1.jsp
<bean:define id="catMgr" name="kkEng" property="categoryMgr" type="com.konakart.al.CategoryMgr"/>
<bean:define id="catList" name="catMgr" property="catMenuList" type="java.util.List"/>

Debug SelectCategoryAction1.java

regards, rula (newbie)
Hi ming,

I want to achieve a complete but small and simple gwt frontend.
My entrypoint could be the mail sample in googles gwt 1.5 doc.

First I try to create the ui with panels, widgets and listeners and use hardcoded data like in the mail sample too. Then I try to get the data from the clientEngine over RPC (is it correct!?). It would be not so easy for me, but little by little I recognize the possibilities of gwt.

When starts your new google group probably with development of konakart frontends.
I am interessted but only a gwt newbie.

regards, rula
Hi KonaKarts,

I worked through the basics and more features of googles StockWatcher tutorial and now I will start to use gwt for konakart frontends. Onepagecheckout is embedded gwt in struts. Is this a good entrypoint;-) for me as gwt newbie to start with a complete frontend. How is the way from struts to gwt? How can I simple replace the struts actions by gwt procedure calls, if possible? Many newbie questions, I try to start with the ui. Help would be nice. regards, rula
Programming of KonaKart / Re: markup validation
July 10, 2008, 12:38:34 pm
Hi KonaKarts,

makes it sense to markup konakart in xhtml1.0 strict or transitional ?

regards, rula
Programming of KonaKart / markup validation
July 10, 2008, 12:11:36 pm
Hi konakarts,

is valid markup no topic?

I use w3c markup validator with many failures and no doctype was found !?

regards, rula