Erlang/OTP Forums

Author Message

<  Yaws mailing list  ~  trying to ehtml_expand({ssi, File, Del, Bs}) throws exceptio

Guest
Posted: Fri Sep 21, 2007 3:57 pm Reply with quote
Guest
in one of my YAWS files I tried to manually expand an SSI. I tried a
few different approaches. None worked. The last failed attempt was
this one. It threw a {badrecord,urltype} exception.

<erl>
out(A) ->
MyText = yaws_api:ehtml_expand({ssi,"myssifile.ssi","%%",[]}),
... some other code...
.
</erl>

I believe the exception was generated in yaws_api.erl because get
(yaws_ut) returned undefined here.

ehtml_expand({ssi,File, Del, Bs}) ->
UT = get(yaws_ut),
ARG = get(yaws_arg),
... some more code ...


I was finally able to make it work like this:

<erl>
-include("/usr/local/lib/yaws/include/yaws.hrl").
out(A) ->
put(yaws_ut,#urltype{}),
put(yaws_arg,A),
MyText = yaws_api:ehtml_expand({ssi,"myssifile.ssi","%%",[]}),
... some more code ...

My concern is that I'm abusing the framework. There must be a better
way? Why export the API in yaws_api if:

a) undocumented?
b) has undocumented requirements

Thanks

Richard




-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Erlyaws-list mailing list
Erlyaws-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/erlyaws-list
Post recived from mailinglist

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum