Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2006
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: webmathematica

  • To: mathgroup at smc.vnet.net
  • Subject: [mg65091] Re: [mg64997] webmathematica
  • From: Chris Williamson <chrisw at wolfram.com>
  • Date: Tue, 14 Mar 2006 06:00:10 -0500 (EST)
  • References: <200603111015.FAA15893@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

In Mathematica if a is a Mathematica variable, you can do something like...

<msp:evaluate>

If[a === 1, 
  MSPFormat[ MSPToExpression[ToString[a-b]], TraditionalForm, "JPEG"],
  MSPFormat[ MSPToExpression[ToString[a+b]], TraditionalForm, "JPEG"]
]

</msp:evaluate>

In Java if a is a Java variable, you can do something like...

<%
if (a == 1) {
%>

<msp:evaluate>
MSPFormat[ MSPToExpression[ToString[a-b]], TraditionalForm, "JPEG"]
</msp:evaluate><br>

<%
} else {
%>

<msp:evaluate>
MSPFormat[ MSPToExpression[ToString[a+b]], TraditionalForm, "JPEG"]
</msp:evaluate>

<%
}
%>

There are also if tags that are much cleaner than the Java syntax, that 
are available from jakarta.apache.org, in the Standard Taglib.

Chris

liv elena wrote:
>      hello,
>   
> i ask you very much to help me with a problem.
> i want to write "if/then/else" instruction
> in jsp code like next example:
>
> if (a==1)
> then
> {
> <msp:evaluate>
> MSPFormat[ MSPToExpression[ToString[a-b]], TraditionalForm, "JPEG"]
> </msp:evaluate><br>
>
> <msp:evaluate>
> MSPFormat[ MSPToExpression[ToString[a+b]], TraditionalForm, "JPEG"]
> </msp:evaluate>
> }
>
> else
> {
> ...................
> ...................
> }
>
> i use jsp files for webmathematica server.
> thank you very much
>
>   
>     
> 		
>
>   


  • Prev by Date: Re: ShadowPlot3D
  • Next by Date: Re: Re: How to get page breaks to work for printing
  • Previous by thread: webmathematica
  • Next by thread: Combining Matrices