How to combine MSPShow and MSPReturn in one block in webMathematica

Dear All,

I am trying to develop a webMathematica website using a jsp file. In my JSP file I can successfully generate a table as input data for plotting a curve. I can then display the plot using MSPShow within my msp:evaluate block. My problem is that I cannot use MSPReturn right after MSPShow in the same block, unless I suppress the display using a semicolon “MSPShow[plot];”. My question is how can I use both MSPShow and MSPReturn inside my msp:evaluate?

The jsp code is attached.

Thanks!

Cheers,

Hadi