> I have
> designed a JSP Page as an UI for the user to enter formulas. If the
> user enters a formula like if(price>localPrice) then price=10 else
> price = 20.
> 1) When should i check this line for errors? Like it should be done
> before saving this formula or while entering itself?
You can do it either way, but writing a parser which can assyne the
input is complete is easier.
> 2) Also can i save these in the database itself?
Any information which you can represent on a computer can be saved in a
DB, if only as a binary stream.
> If yes what should i
> do to retreive and convert to java code, as placing braces "{" properly
> etc.
This is the first time I see you stating your intent to convert the
formula to Java. Doing this would require writing a full blown compiler. As
I mentioned earlier, ask on comp.compilers.
- Oliver