[seasar-dotnet:2290] Re: S2Fisshplate+ASP.NETのテンプレートファイルパス
koala
[E-MAIL ADDRESS DELETED]
2013年 6月 10日 (月) 11:03:59 JST
hajimeniさん
返信ありがとうございます。koalaです。
URL用の属性を作ってインターセプター側で変換することにしました。
FPTemplateUrlAttribute.cs
*---
using System;
using System.Collections.Generic;
using System.Text;
namespace Seasar.S2Fisshplate.Attr
{
[AttributeUsage(AttributeTargets.Method, AllowMultiple=false)]
public class FPTemplateUrlAttribute : Attribute
{
private readonly string _url;
public string Url
{
get { return _url; }
}
public FPTemplateUrlAttribute(string url)
{
_url = url;
}
}
}
---*
FPQuillInterceptor.cs
*---
else if (o is FPTemplateUrlAttribute)
{
path = System.Web.HttpContext.Current.Server.MapPath(((FPTemplateUrlAttribute)o).Url);
---*
それから、どうせインターセプターを修正して使うなら・・・ということで、
Excel帳票の作成日時「予約語now」も追加することにしました。
*---
__obj__["data"] = bean;
__obj__["now"] = DateTime.Now;
---*
以上です。
seasar-dotnet メーリングリストの案内